Simple PHP calculator
#2
Posted 19 April 2008 - 05:07 PM

FA-Q
Thats right. I said it. How you like me now?!?!?
Hyperlisk was here
#3
Posted 22 April 2008 - 02:50 AM
Version 1.1 should be without the waiting post between, make it read the intire command line then sybstring or explode it and let it do a full calc in the end, Im dare you to do that :P
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
Yes private, thats exactly it. War's over, we won.
Turns out you're the big hero and we're gonna hold a parade in your honor.
I get to drive the float, and Simmons here IS IN CHARGE OF CONFETTI!!!
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
#5
Posted 22 April 2008 - 03:57 PM
#6
Posted 22 April 2008 - 04:32 PM
I can't seem to get that working with user input.You could use eval(); Just make sure you filter out everything that shouldn't be in a math expression.
eval("\$answer = 1+1;");Works fine, but$str = "\"\\\$answer =".$_POST["value"].";\""; eval($str);doesn't, when I enter "1+1"
#7
Posted 22 April 2008 - 05:04 PM
<?php
$str = "THIS IS NOT VALID MATH STUFFZ 1+1+(2*3) ALSO NOT VALID MATH STUFFZ";
$str = preg_replace('/[^0-9-\/\*\+\(\)]*/','',$str);
$ret = eval('return ('.$str.');');
var_dump($ret);
?>
#8
Posted 22 April 2008 - 05:58 PM
Though, it's not like this is really a major or important project. Thanks all the same.
#9
Posted 22 April 2008 - 07:00 PM
#10
Posted 22 April 2008 - 10:19 PM
Do not want.
#12
Posted 23 April 2008 - 09:54 AM
#13
Posted 24 April 2008 - 12:38 AM
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
Yes private, thats exactly it. War's over, we won.
Turns out you're the big hero and we're gonna hold a parade in your honor.
I get to drive the float, and Simmons here IS IN CHARGE OF CONFETTI!!!
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
#14
Guest_viky_*
Posted 26 January 2011 - 02:22 AM
http://www.phpkode.c...hp-calculators/
#15
Posted 26 January 2011 - 06:12 AM
you awaken in the intestinal tract of satan. you must defeat the hydra to escape. your only weapon is righteous anger.
#16
Posted 30 January 2011 - 11:38 AM

Or, to put it more politely, "Neener neener."
-all my friends that came with are drinking out in the car
--forever alone
+\- joke's on them i'm too drunk to drive
#17
Posted 30 January 2011 - 01:40 PM
Also I'm posting here just to get you excited. Then let your hopes and dreams be crushed once more.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users













