variable variables
| From: | Mike Krisher | Date: | Thu, 17 Jan 2002 16:11:43 +0000 |
| Subject: | variable variables | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-80924@lists.php.net to get a copy of this message | ||
I can not wrap my head around variable variables today, not awake yet or
something.
For instance I trying something like this:
while ($i<$loopcounter) {
$temp = "size";
$valueofsize = $$temp$i;
$i++;
}
this doesn't work obviously, $valueofsize ends up with a literal value of
"$size1". But I need it to equal the value of a variable named $size1. Do I
need to use a eval() or something?
Thanks in advance,
» Michael Krisher
mike@hyperquake.com