Afficher un message
Vieux 27/09/2007, 22h34   #1
Old Caledonia
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Does PHP5 support dynamic variables?

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


  Réponse avec citation
 
Page generated in 0,08246 seconds with 9 queries