note 20287 deleted from function.array-search by felipe
| From: | felipe@php.net | Date: | Sun, 10 Feb 2008 13:12:01 +0000 |
| Subject: | note 20287 deleted from function.array-search by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-135971@lists.php.net to get a copy of this message | ||
Note Submitter: admin_espace at algomas dot fr
----
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));