note 20287 added to function.array-search

From: Date: Thu, 28 Mar 2002 17:52:02 +0000
Subject: note 20287 added to function.array-search
Groups: php.notes 
Request: Send a blank email to php-notes+get-28347@lists.php.net to get a copy of this message
array search returns _a_ key not the first key. From my tests (linux-apache-php 4.1.2) it returns the last (though this may not be reliable). i.e. the following all output 7 print_r(array_search(1,array(0,1,1,1,1,1,6,1,8,9),true)); print_r(array_search(1,array(0,1,2,3,4,5,6,1,8,9),true)); print_r(array_search(1,array(1,0,2,3,4,5,6,1,8,9),true)); -- http://www.php.net/manual/en/function.array-search.php http://master.php.net/manage/user-notes.php?action=edit+20287 http://master.php.net/manage/user-notes.php?action=delete+20287 http://master.php.net/manage/user-notes.php?action=reject+20287

« previous php.notes (#28347) next »