note 12121 deleted from function.in-array by jimw

From: Date: Fri, 07 Dec 2001 21:07:43 +0000
Subject: note 12121 deleted from function.in-array by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-21971@lists.php.net to get a copy of this message
in V4.04 the third parameter seems to be optional, so this is my 1:1 for php3: function in_array ($needle, $haystack, $strict=false) { if (is_array ($haystack) && count($haystack)) for (reset($haystack); $x=each($haystack); ) if ($needle==$x[1] && (!$strict || gettype($needle)==gettype($x[1]))) return true; return false; }

« previous php.notes (#21971) next »