Skip to content

Instantly share code, notes, and snippets.

@theissn
Last active July 18, 2017 18:36
Show Gist options
  • Save theissn/8a9bb8ff8982a4b48875615bbba81105 to your computer and use it in GitHub Desktop.
Save theissn/8a9bb8ff8982a4b48875615bbba81105 to your computer and use it in GitHub Desktop.
PHP fint in multi dimen.. arr
function in_array_r($needle, $haystack, $strict = false) {
foreach ($haystack as $item) {
if (($strict ? $item === $needle : $item == $needle) || (is_array($item) && in_array_r($needle, $item, $strict))) {
return true;
}
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment