Dear friends,
I have the following function:
<?php
function Output () {
global $cond1, $cond2, $cond3, $val1, $val2, $val3, $output1, $output2, $output3, $output4;
if ($cond1 == $val1)
{print "output 1"; $output1;}
elseif ($cond2 == $val2)
{print "output 2"; $output2;}
elseif ($cond3 == $val3)
{print "output 3"; $output3;}
else print "output 4"; $output4;
} // end function Output;
?>
The 'print "$output #"' part is there for debugging only.
Later on, I assign values to the conditions, values and outputs and call the function with eval:
<?php
eval("print Generate();");
?>
That is causing all 4 possible outputs to be printed. The test prints (print output #), however, are not all printed. Only one is printed and usually not the one I expect. I confess I'm finding it hard to get the hang of 'eval'. Can someone please enlighten me?
Thank you,
Luciano ES
Santos - SP - Brasil