Re: Variable Variable with array
| From: | Gyozo Papp | Date: | Mon, 07 May 2001 20:27:26 +0000 |
| Subject: | Re: Variable Variable with array | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-51823@lists.php.net to get a copy of this message | ||
are you thinking of what this snippet does:
$menu = 'menu2';
$i = 2;
echo ${$menu}[$i];
----- Original Message -----
From: "Brandon Orther" <orther@webintellects.com>
To: "PHP User Group" <php-general@lists.php.net>
Sent: 2001. május 7. 22:16
Subject: [PHP] Variable Variable with array
> Hello,
>
> I am trying to use variable variable. with arrays. this may be hard to
> understand so here is an example:
>
> $menu1[0] = "1";
> $menu1[1] = "2";
> $menu1[2] = "3";
>
> $menu2[0] = "1";
> $menu2[1] = "2";
> $menu2[2] = "3";
>
> $menu3[0] = "1";
> $menu3[1] = "2";
> $menu3[2] = "3";
>
> does anyone know the proper way to use variable variable with arrays?
>
> Thanks
>
> Brandon
>
>
> --
> 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
>