Skip to Content


Checks an array for items from another array.

PHP July 13, 2017


nebula()->in_array_any($needles, $haystack)


(Required) (Array) An array of elements to look for
Default: None

(Required) (Array) An array of elements to search within
Default: None

Request or provide clarification »

Additional Notes

This function will return boolean. True if any of the needles are found, and false if none of them are.

Was this page helpful? Yes No

    A feedback message is required to submit this form.

    Please check that you have entered a valid email address.

    Enter your email address if you would like a response.

    Thank you for your feedback!

    Source File

    Located in /libs/Utilities/Utilities.php on line 868.

    No Hooks

    This function does not have any filters or actions available. Request one?
            public function in_array_any($needles, $haystack){
                if ( is_string($haystack) ){
                    $haystack = array($haystack); //Convert to an array if a string is provided
                return (bool) array_intersect($needles, $haystack);


    This function can not be short-circuited with an override filter. Request one?