note 3301 modified in in_array by ronabop
| From: | ronabop@php.net | Date: | Wed, 18 Oct 2000 05:12:06 +0000 |
| Subject: | note 3301 modified in in_array by ronabop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-6635@lists.php.net to get a copy of this message | ||
A more optimised version for php3 than the one above:
function in_array($needle,$haystack)
{
for($i=0;$i<count($haystack) && $haystack[$i] !=$needle;$i++);
return ($i!=count($haystack));
}
http://www.php.net/manual/function.in-array.php