Array Question

From: Date: Mon, 28 Oct 2002 22:48:00 +0000
Subject: Array Question
Groups: php.general 
Request: Send a blank email to php-general+get-121784@lists.php.net to get a copy of this message
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: echo $myarray[something] would return 'a'; I know I can do a list($key,$value) but I don't need to loop through the array, I just need to be able to retrieve the key name from any point in the array. Thanks for any help.

« previous php.general (#121784) next »