note 72640 deleted from function.array-search by peehaa
| From: | peehaa@php.net | Date: | Fri, 07 Apr 2017 10:34:50 +0000 |
| Subject: | note 72640 deleted from function.array-search by peehaa | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-209002@lists.php.net to get a copy of this message | ||
Note Submitter: elvenone at gmail dot com
----
<?php
// Search an array in reverse order.
function array_reverse_search($value, $array) {
for($i = sizeof($array)-1; $i>=0; $i--) {
if ($array[$i] == $value) return $i;
}
return -1;
}
?>