RE: [PHP] Variables in variable names
| From: | Ralph Guzman | Date: | Wed, 09 May 2001 11:26:23 +0000 |
| Subject: | RE: [PHP] Variables in variable names | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-52070@lists.php.net to get a copy of this message | ||
As an alternative you can use associative arrays
$i = 0;
$i = 1;
$i = 2;
$i = 3;
$name[$i];
-----Original Message-----
From: seriousj [mailto:icjfm0@yahoo.com]
Sent: Wednesday, May 09, 2001 4:09 AM
To: php-general@lists.php.net
Subject: [PHP] Variables in variable names
Hello,
I need some help (newbie).
I have some variable names with the form:
$name_1
$name_2
$name_3
$name_4...
I want to access them by doing something like this:
$i=0
$name_$i
This doesn't work, how do I include another variable in the name of a
variable?.
Cheers
John
--
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