You are here: Does PHP5 support dynamic variables? « All PHP « IT news, forums, messages
Does PHP5 support dynamic variables?

Posted by Old Caledonia on 09/27/07 20:34

Hi,

I'm in the process of upgrading an aged php application to php5
compatibility.

One script has me stumped. Here's a code snippet:

while($categoryrow = mysql_fetch_array($categoryresult)) {
$categoryval = $categoryrow["category"];
$categoryidval = $categoryrow["categoryid"];
$tempbox = "box" . $categoryidval;

//assign dynamic variable
$categoryvalue = ${$tempbox};

// end code snippet.

If I echo $tempbox, I get a list of numerical values (correctly).
If I echo $categoryvalue, my data is empty.

If it's not a PHP5 thing then I'm lost - any ideas/suggestions?

Neil

 

Navigation:

[Reply to this 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

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