Advertisement
Guest User

Untitled

a guest
Jun 19th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.29 KB | None | 0 0
  1. function findArrayWithKeyValue($array, $search_key, $search_value)
  2. {    
  3.     foreach($array as $key=>$value)
  4.     {
  5.         if(is_array($value))
  6.             return findArrayWithKeyValue($value, $search_key, $search_value);
  7.  
  8.         if($key == $search_key &&
  9.            $value == $search_value)
  10.             return $array;
  11.     }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement