Skip to content

Instantly share code, notes, and snippets.

@danielnv18
Last active August 29, 2015 13:56
Show Gist options
  • Save danielnv18/8832178 to your computer and use it in GitHub Desktop.
Save danielnv18/8832178 to your computer and use it in GitHub Desktop.
<?php
function in_multiarray($elem, $array) {
$top = sizeof($array) - 1;
$bottom = 0;
while($bottom <= $top) {
if($array[$bottom] == $elem)
return true;
else
if(is_array($array[$bottom]))
if(in_multiarray($elem, ($array[$bottom])))
return true;
$bottom++;
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment