|
Posted by tobimarq on 09/09/05 23:13
hi all,
I wonder if the following is possible in php:
I want php to 'interpret' a string that contains (a simple kind of)
mathematical calculation, like
$var='25*3';
$result= (int) $var;
//according to the php manual, $result contains 25,
//but I want the result at the end to contain: 75
Is there a php function or construct, that does this?
ok, I know I could write a function that parses and splits the string
$var in the relevant parts, then calculating the result and give it
back. In fact, that wouldn't even be complicated.
But shouldn't it be somehow possible in a 'smarter' way?
thank you for any comment...
[Back to original message]
|