On Tue, Aug 12, 2008 at 9:30 AM, Platonides <Platonides(a)gmail.com> wrote:
Instead of writing a math parser in php, what about
using php own
ability to cope with mathematical expressions via eval()?
It would obviously need strong checkings to avoid opening holes, but if
all the characters match [0-9]+-*/%() it should be safe to pass to the
php parser.
Maybe . . . what does PHP do on division by zero? I admit that's the
only thing I can think of that would be a problem. (You should
probably allow . too, for a decimal point.)