Date Added: 14/01/2015

in_array_r $needle, $2darray, 2 dimentional array  to be searched $uniqueKey   -----> $needle['ID']

function in_array_r($needle, $2darray,$uniqueKey) {
 $found = false;
 foreach ($2darray as $item) {
 if ($item[$uniqueKey] == $needle[$uniqueKey]) {
 $found = true;
 break;
 } elseif (is_array($item)) {
 $found = in_array_r($needle, $item);
 if($found) {
 break;
 }
 }
 }
 return $found;
}

 

Last Update: Posted by: müslüm ÇEN
Not Commented Yet !
Please login in order to comment . Login