Created
January 24, 2020 14:47
-
-
Save linkdigitaluk/05faa4ed2ad292e08b438d86c7d4848a to your computer and use it in GitHub Desktop.
[Find multiple items within an array] Useful php array methods to check multiple values exist in an array #php #array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function in_array_any($needles, $haystack) { | |
return !empty(array_intersect($needles, $haystack)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment