Re: variable variables
| From: | Steve Cayford | Date: | Thu, 17 Jan 2002 16:43:56 +0000 |
| Subject: | Re: variable variables | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-80931@lists.php.net to get a copy of this message | ||
On Thursday, January 17, 2002, at 10:11 AM, Mike Krisher wrote:
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; try $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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net