求教:PHP如何将一个无限分类转换为一个易做图数组?
如何输出类似如下易做图数组:
Array
(
[0] => Array
(
[id] => 1
[name] => 新闻
[parent] => Array
(
[0] => Array
(
[id] => 2
[name] => PHP新闻
[parent] => Array
(
[0] => Array
(
[id] => 3
[name] => PHP6.0出来了
)
)
)
[1] => Array
(
[id] => 6
[name] => mysql新闻
[parent] => Array
(
[0] => Array
(
[id] => 7
[name] => 暂无mysql新闻
)
)
)
)
)
[1] => Array
(
)
)