aboyadzhiev/php-math-parser
最新稳定版本:2.0.0
Composer 安装命令:
composer require aboyadzhiev/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 simple example of evaluating math expression
<?php $parser = new \Math\Parser(); $expression = '1 + 2 * 3 * ( 7 * 8 ) - ( 45 - 10 )'; $result = $parser->evaluate($expression); echo $result; // 302 $expression = '-2+-2*13*(7*8)-(415-0.1)'; $result = $parser->evaluate($expression); echo $result; // -1872.90
TODO
- Add additional translation strategy
License
MIT, see LICENSE.
统计信息
- 总下载量: 42.07k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 25
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-04