Arr.php
public static function contains(array $haystack, $needle, bool $strict = true)
    {
        foreach ($haystack as $value) {
            if ((!$strict && $needle == $value) || $needle === $value) {
                return true;
            }

            if (is_array($value) && static::contains($needle, $value, $strict)) {
                return true;
            }
        }

        return false;
    }
public static function contains(array $haystack, $needle, bool $strict = true)
    {
        foreach ($haystack as $value) {
            if ((!$strict && $needle == $value) || $needle === $value) {
                return true;
            }

            if (is_array($value) && static::contains($needle, $value, $strict)) {
                return true;
            }
        }

        return false;
    }
public static function contains ( array $ haystack , $ needle , bool $ strict = true ) { foreach ( $ haystack as $ value ) { if ( ( ! $ strict && $ needle == $ value ) || $ needle === $ value ) { return true ; } if ( is_array ( $ value ) && static :: contains ( $ needle , $ value , $ strict ) ) { return true ; } } return false ; }
Checks whether the given value is contained within the given array. Equivalent of a recursive in_array.
When you are sure you are dealing with a 1-dimensional array, use in_array instead to avoid the overhead.

@param   array   $haystack   The array to search in.
@param   mixed   $needle     The value to search for.
@param   bool    $strict     Whether strict equality matches should be performed on the values.
@return  bool                True when the value was found in the array, false otherwise.
Checks whether the given value is contained within the given array . Equivalent of a recursive in_array . When you are sure you are dealing with a 1 - dimensional array use in_array instead to avoid the overhead .