RE: [PHP] Array Question
| From: | Ford, Mike [LSS] | Date: | Tue, 29 Oct 2002 12:08:34 +0000 |
| Subject: | RE: [PHP] Array Question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-121839@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: PHP List [mailto:php_list@ibcnetwork.net]
> Sent: 28 October 2002 22:48
> To: php
> Subject: [PHP] Array Question
>
>
> Hi,
> Lets say I have a simple array like this:
> $myarray = array("a"=>"b","d"=>"c");
>
> echo $myarray[0] will return 'b';
>
> How can I get the name of the index? so:
I'd suggest a look at array_keys()
(http://www.php.net/manual/en/function.array-keys.php). Seems to be the
nearest to what you want.
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211