I am stuck on something in PHP
$l = $par['Length'];
$w = $par['Width'];
$d = $par['Depth'];
$length = $par['Expr_1'];
$width = $par['Expr_2'];
$par is an array read from a database.
Length, Width, Depth are numbers
Expr_1 & Expr_2 are formulas stored as strings
ie something like this:
($l + .0625) * ($w + .125) * ($l + .125) * ($w + .0625) + 1.625
What should happen is that $l $w should substitute with the values. If I echo $l,$w,$d independently they have the right values. If I echo $length or $width it shows the formula.
Even when I try eval("$width = {$par['Expr_2']};"); it doesn't force it to calculate instead of just read the formula. I know the formula is right because if I manually stick it into $length or $width it works fine.
eval. 2. If you still want to use it, make sure it is enabled from php.ini.