Last active
          October 12, 2015 03:11 
        
      - 
      
 - 
        
Save ergunozyurt/94f32b32a1aa018c0b76 to your computer and use it in GitHub Desktop.  
    Searches for the given key in multidimension array and returns its value
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | function searchArrayForKey($search,$array) { | |
| $foundArray= array(); | |
| foreach ($array as $key => $value) { | |
| if($key === $search) | |
| { | |
| $foundArray = $value; | |
| break; | |
| } | |
| else | |
| { | |
| if(is_array($value)){ | |
| return searchSubArray($search,$value); | |
| } | |
| } | |
| } | |
| return $foundArray; | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment