[SOLVED] Trouble With Variable Variables
Posted: Fri Mar 04, 2005 12:09 pm
I am trying to set some variable variables for use further down my script. I've got:
But, when I try to access the variable variables they don't produce anything (i.e. nothing is output to the screen). 
I've found that if I make the variable variables static (e.g. $me1 instead of $me{$i}), I get what I'm expecting.
Code: Select all
<?php
// ...other code to get results from DB...
$i = 1;
while($array2 = mysql_fetch_assoc($result)) {
$me{$i} = $array2ї'me'];
$myself{$i} = $array2ї'myself'];
isset($array2ї'andI']) ? $andI{$i} = $array2ї'andI'] : $andI{$i} = NULL;
$i++;
}
echo $me1;
echo $myself1;
echo isset($andI1) ? $andI1 : "";
?>I've found that if I make the variable variables static (e.g. $me1 instead of $me{$i}), I get what I'm expecting.