Hello,
I want to do the below
$text1= 'what is 5 * 5';
$text2=str_replace("what is","",$text1);
$text2=str_replace(" ","",$text2);
//so now $text2 = 5*5
echo $text2;
I want it to echo 25 the answer to 55 but instead it just echos 55.
I want to build a calculator with one input box, strip out any other text to only be left with the math problem, then have php calculate the answer like google's calculator.
I guess maybe it would be possible with javascript to write to the file to have a true echo 5 * 5 rater than echo $text2 but is there a way to do this all within php??
Thanks.