Reply to Re: Execute command from array

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация