Take a look at eval(): http://de2.php.net/manual/en/function.eval.php
Regards, Torsten "Enfors Christer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hi. I need a function that takes a mathematical expression in the form of a string, and calculates the result. PHP itself doesn't seem to provide one. I need something which can handle strings like: 10*73.2+3-(4*358.2874)/352 ... and so on. If it handles functions (like cos(), pow(), exp()) too, then that would be great. I'd appreciate any help. Thanks in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php