I would like to execute a string as if it were PHP code.
An example would be:
I would like to convert
$string to executable syntax. Is there a way to do this?
is the function you want. But: eval() is evil!
You can use
eval('round(24.6,2)'), but this is usually frowned upon for multiple reasons. Why do you want to do this?