public function getCountArray($arrayStr){ $max_depth=1; foreach ($arrayStr as $key=>$value){ if(is_array($arrayStr)){ $max=$this->getCountArray($value)+1; if($max_depth<$max){ $max_depth=$max; } } } return $max_depth; }
php递归获取数组深度
最新推荐文章于 2021-04-21 23:13:50 发布