getting numeric index of array
| From: | Christian Dechery | Date: | Sun, 25 Mar 2001 21:58:56 +0000 |
| Subject: | getting numeric index of array | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-45521@lists.php.net to get a copy of this message | ||
I wanna get the numeric index for a multi-dimensional associative array...
I have like
$myArray = array(
"one" => "something",
"two" => "otherthing",
"three" => "whatever"
);
I want to, given the key (or value), it returns me the numeric index for that ocurrence... examples:
given "one" -> returns 0
given "whatever" -> returns 2
given "two" -> returns 1
given "four" -> returns NULL or false...
anyone?
____________________________
. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer