Home  >  Article  >  Backend Development  >  这样的数组如何让它树状显示呢

这样的数组如何让它树状显示呢

WBOY
WBOYOriginal
2016-06-13 12:38:26845browse

这样的数组怎么让它树状显示呢?

Array<br>
(<br>
    [1] => Array<br>
        (<br>
            [id] => 1<br>
            [name] => 世界<br>
            [pid] => 0<br>
            [2] => Array<br>
                (<br>
                    [id] => 2<br>
                    [name] => 中国<br>
                    [pid] => 1<br>
                    [4] => Array<br>
                        (<br>
                            [id] => 4<br>
                            [name] => 湖南<br>
                            [pid] => 2<br>
                        )<br>
<br>
                )<br>
<br>
            [3] => Array<br>
                (<br>
                    [id] => 3<br>
                    [name] => 美国<br>
                    [pid] => 1<br>
                )<br>
 <div class="clear">
                 
              
              
        
            </div>
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