How to determine the dimension of the php array. The copy code is as follows :? Php *** returns the array dimension * @ param [type] $ arr [description] * @ return [type] [description] * functionarrayLevel ($ arr) {$ alarr:
The code is as follows:
/**
* Returns the array dimension.
* @ 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 );
}
$ Arr = array (
'0' => '0 ',
);
Echo arrayLevel ($ arr );
?>
The pipeline code is as follows :? Php/*** return the array dimension * @ param [type] $ arr [description] * @ return [type] [description] */function arrayLevel ($ arr) {$ al = arr...