public static function in_array_multi($needle, $haystack)
    {
        if ($needle == $haystack) {
            return true;
        }

        if (is_array($haystack)) {
            foreach ($haystack as $key => $val) {
                if (is_array($val)) {
                    if (self::in_array_multi($needle, $val)) {
                        return true;
                    }
                } elseif (!strcmp($needle, $key) || !strcmp($needle, $val)) {
                    return true;
                }
            }
        }

        return false;
    }
public static function in_array_multi($needle, $haystack)
    {
        if ($needle == $haystack) {
            return true;
        }

        if (is_array($haystack)) {
            foreach ($haystack as $key => $val) {
                if (is_array($val)) {
                    if (self::in_array_multi($needle, $val)) {
                        return true;
                    }
                } elseif (!strcmp($needle, $key) || !strcmp($needle, $val)) {
                    return true;
                }
            }
        }

        return false;
    }
public static function in_array_multi ( $ needle , $ haystack ) { if ( $ needle == $ haystack ) { return true ; } if ( is_array ( $ haystack ) ) { foreach ( $ haystack as $ key => $ val ) { if ( is_array ( $ val ) ) { if ( self :: in_array_multi ( $ needle , $ val ) ) { return true ; } } elseif ( ! strcmp ( $ needle , $ key ) || ! strcmp ( $ needle , $ val ) ) { return true ; } } } return false ; }
Search a multi-dimensional array for a value.

@param mixed $needle
the value to search for.
@param array $haystack
the multi-dimensional array to search.
@return boolean
true if `$needle` is found in `$haystack`.
true if `$needle` == `$haystack`.
true if `$needle` is found in any of the arrays contained within `$haystack`.
false otherwise.
Search a multi - dimensional array for a value .