iserter / php-expression-evaluator
Mathematical expression evaluator.
Installs: 103
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 8
pkg:composer/iserter/php-expression-evaluator
Requires
- php: >=5.3.0
Requires (Dev)
- phpunit/phpunit: ~4.3
This package is not auto-updated.
Last update: 2018-11-20 10:36:22 UTC
README
Simple mathematical expression parser and calculator.
Install
The recommended way to install this library is through composer.
{ "require": { "iserter/php-expression-evaluator": "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
License
Forked from Adrean Boyadzhiev's php-math-parser. MIT, see LICENSE.