Re: Array question
| From: | Chris | Date: | Thu, 15 Feb 2001 17:57:28 +0000 |
| Subject: | Re: Array question | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-39955@lists.php.net to get a copy of this message | ||
Ok,
But can't the array still be refered to with a number?
So in myarray["something"] is the 50th element in the array, wouldn't:
myarray[49] = myarray["something"]
?
> On Thursday 15 February 2001 01:40, Chris wrote:
>
> > How do I get the index,number of an array if reffering to an array via
> > string? Ex:
> > I have 100 arrays, and I want to know what # myarray["something"] is.
>
> That element doesn't have an index number such arrays are implemented as
> hashes or trees, which don't store data at "fixed positions" (that's a
> very bad explanation, but, well...)
> The "index" is the "key" in this case - in your example it's
> "something".
>
> --
> Christian Reiniger
> LGDC Webmaster (http://sunsite.dk/lgdc/)
>
> I saw God --------- and she was black.
>
> --
> 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