bolstad / textcalculate
Evaluate string based calculations
1
2017-04-23 18:50 UTC
Requires (Dev)
- phpunit/phpunit: 4.0.*
This package is not auto-updated.
Last update: 2026-03-03 10:32:21 UTC
README
Perform calculation on strings and replace placeholders according as configured in an array.
Example:
Given that ITEMS_SOLD = 10 & TAX_RATE = 0.25 AND PROCESS_FEE = 3,
calculate() can solve and return the result for '((ITEMS_SOLD * 15) + PROCESS_FEE) * 0.25'
Please see tests/PlaceholderCalcTest.php for example code