okay, eval(), (a statement not a function), evaluates a string as if it was PHP code (so be careful if users are to enter the argument in an HTML form!!).
I found that it cant really evaluate arithmetica expressions,
in my case, (http://www.njneer.com/math/math.htm) the user will have to type a mathematical function the same way its done in PHP (like adding $ before the variables x,y ) .. also, instead of typing x2 , it would have to be pow ($x, 2).
we can work on that, by manipulating the string the user enters, .. using string functions to add the $ before X,Y , we can also use regular expressions to evaluate xy as pow (x, y) in other words, write an arithmetic expression parser for PHP.
is there already one? .. I think that would be an interesting project for me.
Mahmoud Arram
soph, CoE
NJIT.edu