Justtechjobs.com Find a programming school near you






Online Campus Both


php3-list | 2000051

Re: [PHP3] $$array[] variable From: Zak Greant (zak <email protected>)
Date: 05/04/00

At 11:29 AM 5/4/00 -0700, Todd Wesslen wrote:

>I have a variable that I am accessing using $$variablename. The
>variable is actually an array. I can't seem to access the elements with
>the syntax $$variablename[$index]. Is there any way to do this? Any
>help would be appreciated.

Hi Todd and List,

The parser thinks that you are trying to use $variablename[$index] as the
value for your variable name. Try this syntax instead:

${$variablename}[$index]

Also, check the manual entry on variable variables

HTH,

Zak

-- 
PHP 3 Mailing List <http://www.php.net/>
To unsubscribe, send an empty message to php3-unsubscribe <email protected>
To subscribe to the digest, e-mail: php3-digest-subscribe <email protected>
To search the mailing list archive, go to: http://www.php.net/mailsearch.php3
To contact the list administrators, e-mail: php-list-admin <email protected>