lalabored Posted May 30, 2008 Share Posted May 30, 2008 I need a function that is able to evaluate a string. For example, I have $var = "3+4*5", is there a function that can be like function($var) = answer?? It has to be able to recognize that 4*5 is done first. Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted May 30, 2008 Share Posted May 30, 2008 like this? eval(str_replace('"','','$var = "3+4*5";')); echo $var; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.