lang / equation
A PHP formula parser based on bc_math
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/lang/equation
Requires
- ext-bcmath: *
Requires (Dev)
- phpunit/phpunit: ^10.5
README
基于 bc_math 的 PHP 公式解析器
Install
$ composer install lang\equation
Simple examples
<?php use Lang\Equation\Equation; $expr = Equation::parse('1+1'); echo $expr->getValue(); // Output: 2 // With params // !notice parameter name format: ':param_name:' $expr2 = Equation::parse('2 + :var:'); echo $expr2->getValue(['var' => 2]); // Output: 4
License
MIT license (© 2024 Lang)
Have fun with Equation