src/Arr.php
public static function allIn($allValues, array $array): bool
    {
        if (is_array($allValues)) {
            if (empty($allValues)) {
                return false;
            }

            foreach ($allValues as $value) {
                if (!in_array($value, $array)) {
                    return false;
                }
            }

            // A match was found for all values if we got here
            return true;
        }

        return in_array($allValues, $array);
    }
public static function allIn($allValues, array $array): bool
    {
        if (is_array($allValues)) {
            if (empty($allValues)) {
                return false;
            }

            foreach ($allValues as $value) {
                if (!in_array($value, $array)) {
                    return false;
                }
            }

            // A match was found for all values if we got here
            return true;
        }

        return in_array($allValues, $array);
    }
public static function allIn ( $ allValues , array $ array ) : bool { if ( is_array ( $ allValues ) ) { if ( empty ( $ allValues ) ) { return false ; } foreach ( $ allValues as $ value ) { if ( ! in_array ( $ value , $ array ) ) { return false ; } } // A match was found for all values if we got here return true ; } return in_array ( $ allValues , $ array ) ; }
If all of the provided values is in an array.

This is a convenient function for constructs like in_array('val1', $a) && in_array('val2, $a) etc.

@param array|mixed $allValues Array of needles (will try all for a match)
@param array       $array     Haystack array
@return bool
If all of the provided values is in an array .