I have save formulas and variables in a database and when I retrieve them I want php to calculate the value like so
$x = .0832;
$y = .0673;
$z = 1.5;
$formula = '$x -(($x-$y)*($z-1.0))';
$newformula = str_replace('$x', $x, $formula);
$newformula = str_replace('$y', $y, $newformula);
$newformula = str_replace('$z', $z, $newformula);
echo '</br>'.$newformula;
i can't figure out how to get the answer computed.
Thanks in advanced!!