Posted by ZeldorBlat on 08/12/05 06:13
JW has the correct solution. Another alternative is to use eval(),
but, as many have said before: "If eval is the answer, you're asking
the wrong question."
Just for kicks, here's how you could do it with eval() :
$commands = array(
"Start Date" => "build_date('startdate')",
"End Date" => "build_date('enddate')"
);
foreach($commands as $key => $val) {
echo "<td>$key</td>";
echo "<td>" . eval("return($val);") . "</td>";
}
[Back to original message]
|