note 18925 deleted from function.array-search by felipe

From: Date: Sun, 10 Feb 2008 13:12:08 +0000
Subject: note 18925 deleted from function.array-search by felipe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-135972@lists.php.net to get a copy of this message
Note Submitter: radley25 at earthlink dot net ---- Note to the previous post: <?php $map = array( 'version' => 4 , 'OS' => 'Linux' , 'lang' => 'english' , 'short_tags' => true ); $key = array_search("4",$map); print $key; //returns short_tags //strange results.. $array = array (1,13, 20); $key = array_search("13",$array); print $key; //works as expected //returns 1 ?> If you put the number in quotes it searches for the array number. Try it without the quotes.

« previous php.notes (#135972) next »