//递归取 function getArray($array, $index){ if(!is_array($array)){ return null; } if(isset($array[$index])){ return $array[$index]; } foreach($array as $item){ $return = $this->getArray($item, $index); if(!is_null($return)){ return $return; } } return null; } 另外一种算法:// function get_array_elems($arrResult, $where = "array"){ while(list($key, $value) = each($arrResult)){ if(is_array($value)){ $this->get_array_elems($value, $where . "[$key]"); }else{ for($i = 0; $i < count($value); $i++){ echo $where . "[$key]=" . $value . "<BR>\n"; } } } }
博客
前端高频面试(1)
06-21
152
04-10
450
04-08
270
02-02
981
02-01
178
博客
Uniapp上传图片
01-09
395
12-11
437
12-11
436
11-27
494
10-19
207