note 3301 deleted from function.in-array by jimw
| From: | jimw@php.net | Date: | Fri, 07 Dec 2001 21:06:11 +0000 |
| Subject: | note 3301 deleted from function.in-array by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-21960@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));
}