private static function array_depth($array) { if(!is_array($array)) return 0; $max_depth = 1; foreach ($array as $value) { if (is_array($value)) { $depth = array_depth($value) + 1; if ($depth > $max_depth) { $max_depth = $depth; } } } return $max_depth; }
http://www.bkjia.com/phpjc/1073356.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/1073356.htmltecharticlephp判断数组array的维度(已封装函数) 有时候需要判断array的维度,上网查了下很多事类似种写法,拉杂又搞不懂啥意思。下面是我写的: p...
