Home > php教程 > php手册 > body text

PHP数组维度

WBOY
Release: 2016-06-20 08:42:43
Original
1695 people have browsed it

数组的维度
/**<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元

source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template