PHP Function Code to use PHP's in_array() Function for Multidimensional Arrays
PHP function that modifies the php built in in_array() function allowing you to search for items in a multidimensional array
Home
Short:
/* ------------------------------------------------- function that modifies the php built in in_array() function allowing you to search for items in a multidimensional array -------------------------------------------------- */ function in_array_multi($needle, $haystack) { foreach ($haystack as $item) { if ($item === $needle || (is_array($item) & in_array_multi($needle, $item))) { return true; } } return false; }
source code home