inspirenmy/php-math-parser
最新稳定版本:1.0.0
Composer 安装命令:
composer require inspirenmy/php-math-parser
包简介
Simple mathematical expression parser and calculator.
README 文档
README
Simple mathematical expression parser and calculator.
Install
The recommended way to install Math is through composer.
{
"require": {
"aboyadzhiev/php-math-parser": "dev-master"
}
}
Usage
Here is an simple example of evaluation of mathematical expression
<?php $parser = new \Math\Parser(); $expression = '1 + 2 * 3 * ( 7 * 8 ) - ( 45 - 10 )'; $result = $parser->evaluate($expression); echo $result; //302
TODO
- Add unit tests.
- Add additional strategy for translation from infix to reverse polish notation
License
MIT, see LICENSE.
统计信息
- 总下载量: 3.99k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-02-06