Parse math operations with PHP

前端 未结 6 1911
执笔经年
执笔经年 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 23:12

    I can recommend https://github.com/andig/php-shunting-yard which is a PSR-0 compatible implementation of the Shunting Yard algorithm.

提交回复
热议问题