php 判断数组是几维数组_php技巧
May 17, 2016 am 09:06 AM/**
* 返回数组的维度
* @param [type] $arr [description]
* @return [type] [description]
*/
function arrayLevel($arr){
$al = array(0);
function aL($arr,&$al,$level=0){
if(is_array($arr)){
$level++;
$al[] = $level;
foreach($arr as $v){
aL($v,$al,$level);
}
}
}
aL($arr,$al);
return max($al);
}
?>

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to remove duplicate elements from PHP array using foreach loop?

PHP array key value flipping: Comparative performance analysis of different methods

PHP array multi-dimensional sorting practice: from simple to complex scenarios

The Art of PHP Array Deep Copy: Using Different Methods to Achieve a Perfect Copy

Best Practices for Deep Copying PHP Arrays: Discover Efficient Methods

Application of PHP array grouping function in data sorting

The role of PHP array grouping function in finding duplicate elements

PHP array merging and deduplication algorithm: parallel solution
