Home > Article > Backend Development > 这样的数组如何让它树状显示呢
这样的数组怎么让它树状显示呢?
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>