note 72640 modified in function.array-search by danbrown

From: Date: Wed, 29 Apr 2009 12:59:25 +0000
Subject: note 72640 modified in function.array-search by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-153981@lists.php.net to get a copy of this message
<?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; } ?> --was-- <?php function array_reverse_search($value, $array) { for($i = sizeof($array)-1; $i>=0; $i--) { if ($array[$i] == $value) return $i; } return -1; } ?> http://php.net/manual/en/function.array-search.php

« previous php.notes (#153981) next »