Пример #1
0
function in_arrayr($needle, $haystack)
{
    foreach ($haystack as $v) {
        if ($needle == $v) {
            return true;
        } elseif (is_array($v)) {
            if (in_arrayr($needle, $v) === true) {
                return true;
            }
        }
    }
    return false;
}
Пример #2
0
 function in_arrayr($needle, $haystack, $strict = false)
 {
     foreach ($haystack as $item) {
         if (($strict ? $item === $needle : $item == $needle) || is_array($item) && in_arrayr($needle, $item, $strict)) {
             return true;
         }
     }
     return false;
 }