我有以下数组:
Array
(
[0] => stdClass Object
(
[categoryid] => 60
[categoryName] => Parent Category A
[categoryParent] =>
)
[1] => stdClass Object
(
[categoryid] => 65
[categoryName] => Parent Category B
[categoryParent] =>
)
[2] => stdClass Object
(
[categoryid] => 68
[categoryName] => Child Category A
[categoryParent] => 65
)
[3] => stdClass Object
(
[categoryid] => 69
[categoryName] => Super Child Category A
[categoryParent] => 68
)
)
我需要最终得到一个这样的列表:
- 父类 A
- 父类 B
- 子类别 A
- 超级儿童A类
- 子类别 A
最简单的方法是什么?