a chi potesse servire...ecco la soluzione
Codice PHP:
function _array_search($needle,$haystack ,$strict=false) {
if (!is_array($haystack)) return false;
for ($i=0; $i<count($haystack); ++$i) {
if ($strict) {
// STRICT
if ((get_class($needle)==get_class($haystack[$i])) && ($needle==$haystack[$i]))
return $i;
}else{
// NO STRICT
if ($needle==$haystack[$i])
return $i;
}
}
return false;
}

Rispondi quotando