in_array() should now be compatible with php3.

This commit is contained in:
skeeter 2002-03-16 02:59:13 +00:00
parent 50175afd99
commit 9dd8a8d708

View File

@ -231,7 +231,7 @@
* Searches haystack for needle and returns TRUE if it is found in the array, FALSE * Searches haystack for needle and returns TRUE if it is found in the array, FALSE
* otherwise. * otherwise.
*/ */
function in_array($needle, $haystack, $strict = False) function in_array($needle, $haystack='', $strict = False)
{ {
if(is_array($haystack) && count($haystack)) if(is_array($haystack) && count($haystack))
{ {
@ -244,6 +244,10 @@
} }
return False; return False;
} }
elseif($haystack=='')
{
return False;
}
} }
/* is_bool (PHP 4 >= 4.0.0) /* is_bool (PHP 4 >= 4.0.0)