Home >php教程 >php手册 >PHP数组维度

PHP数组维度

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-20 08:42:431750browse

数组的维度
/**<br>  * 数组的维度<br>  * @param array $arr 数组<br>  * @return int 维数<br>  */<br> function _array_level($arr)<br> {<br>     $al = array(0);<br>     function aL($arr, &$al, $level=0)<br>     {<br>         if(is_array($arr)) {<br>             $level++;<br>             $al[] = $level;<br>             foreach($arr as $v)<br>             {<br>                 aL($v,$al,$level);<br>             }<br>         }<br>     }<br>     aL($arr,$al);<br>     return max($al);<br> }

AD:真正免费,域名+虚机+企业邮箱=0元

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn