Parse math operations with PHP

前端 未结 6 1909
执笔经年
执笔经年 2020-12-01 22:14

I am working on a project where I need to make a function that will parse the 4 default math operations (addition, subtraction, multiplication, division). It would be nice i

6条回答
  •  臣服心动
    2020-12-01 22:58

    if you want a truly safe math parser, then eval won't do it. bcParserPHP can do it. It is implemented in PHP and does not use eval, thus it is very secure.

提交回复
热议问题