This commit is contained in:
skeeter 2001-04-22 14:18:50 +00:00
parent 92a18a3a12
commit 584ea9936d

View File

@ -186,8 +186,13 @@
} }
// This is a php3/4 compliant in_array(), used only below in check_db() so far // This is a php3/4 compliant in_array(), used only below in check_db() so far
function isinarray($needle,$haystack=array()) function isinarray($needle,$haystack='')
{ {
if($haystack == '')
{
settype($haystack,'array');
$haystack = Array();
}
for($i=0;$i<count($haystack) && $haystack[$i] !=$needle;$i++); for($i=0;$i<count($haystack) && $haystack[$i] !=$needle;$i++);
return ($i!=count($haystack)); return ($i!=count($haystack));
} }