note 18925 added to function.array-search

From: Date: Sun, 10 Feb 2002 03:40:21 +0000
Subject: note 18925 added to function.array-search
Groups: php.notes 
Request: Send a blank email to php-notes+get-26433@lists.php.net to get a copy of this message
Note to the previous post: $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. -- http://www.php.net/manual/en/function.array-search.php http://master.php.net/manage/user-notes.php?action=edit+18925 http://master.php.net/manage/user-notes.php?action=delete+18925 http://master.php.net/manage/user-notes.php?action=reject+18925

« previous php.notes (#26433) next »