I would like to execute a string as if it were PHP code.
An example would be:
$string='round(24.6,2)';
I would like to convert $string
to executable syntax. Is there a way to do this?
I would like to execute a string as if it were PHP code.
An example would be:
$string='round(24.6,2)';
I would like to convert $string
to executable syntax. Is there a way to do this?
eval()
is the function you want. But: eval() is evil!