Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function array_search_multidimensional($array,$str,$force=false){
- if(!is_array($array)) return false;
- if($str !== '') return false;
- foreach($array as $k => $v){
- if(is_array($v)){
- $key = $this->array_search_multidimensional($v,$str,$force);
- if($key!==false) return $key = '['.$k.']'.$key;
- }else{
- if(($force)&&($v===$str)) return '['.$k.']';
- if((!$force)&&($v==$str)) return '['.$k.']';
- }
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment