Justtechjobs.com Find a programming school near you






Online Campus Both


php3-list | 2000051

Re: [PHP3] $$array[] variable From: Thomas Deliduka (thomas <email protected>)
Date: 05/04/00

On 5/4/00 2:29 PM Todd Wesslen said:

> 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.

The manual says:

---
In order to use variable variables with arrays, you have to resolve an
ambiguity problem. That is, if you write $$a[1] then the parser needs to
know if you meant to use $a[1] as a variable, or if you wanted $$a as the
variable and then the [1] index from that variable. The syntax for resolving
this ambiguity is: ${$a[1]} for the first case and ${$a}[1] for the second.
---
at: http://www.php.net/manual/language.variables.variable.php

--

Thomas Deliduka IT Manager -------------------- New Eve Media 5629 Westlake Drive Galloway, OH 43119-8498 Phone: 614-870-3098 Fax: 614-870-7486 Mobile: 614-537-6445

-- 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>