Answer the question
In order to leave comments, you need to log in
Are there solutions for mathematical calculations from a string?
Currently using:
https://stackoverflow.com/questions/18880772/calcu...
Usage:
$Cal = new Field_calculate();
$result = $Cal->calculate('5+7'); // 12
$result = $Cal->calculate('(5+9)*5'); // 70
$result = $Cal->calculate('(10.2+0.5*(2-0.4))*2+(2.1*4)'); // 30.4
create_function()
is deprecated $compute = create_function('', 'return '.$input.';');
Answer the question
In order to leave comments, you need to log in
Found a solution that worked for me:
https://ru.stackoverflow.com/questions/454598/%D0%...
Okay, google. We write a calculator in ... yes, at least in puff, what's the difference?
PS. eval don't offer
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question