Page 1 of 1

Simple math question

Posted: Sun Jun 20, 2010 6:49 am
by lenton
I have this code:

Code: Select all

$input = "3-1";
$output = $input;
How would I get $output to equal '2'?

Re: Simple math question

Posted: Sun Jun 20, 2010 11:37 am
by Apollo

Code: Select all

eval("\$output = $input;");

Re: Simple math question

Posted: Wed Jun 23, 2010 6:55 am
by lenton
Thanks for your help, I've got it working now :)