Array ( [0] => Array ( [id] => 1 [name] => --A [parent_id] => 0 [children] => Array ( [3] => Array ( [id] => 3 [name] => ----a [parent_id] => 1 [level] => 2 [children] => Array ( [4] => Array ( [id] => 4 [name] => ------aa [parent_id] => 3 [level] => 3 [children] => Array ( [6] => Array ( [id] => 6 [name] => --------aaa [parent_id] => 4 [level] => 4 [children] => Array ( )
)
)
)
)
)
)
)
[1] => Array
(
[id] => 2
[name] => --B
[parent_id] => 0
[children] => Array
(
[5] => Array
(
[id] => 5
[name] => ----b
[parent_id] => 2
[level] => 2
[children] => Array
(
)
)
)
)
)
1
astome OP Array
( [0] => Array ( [id] => 1 [name] => --A [parent_id] => 0 [children] => Array ( [3] => Array ( [id] => 3 [name] => ----a [parent_id] => 1 [level] => 2 [children] => Array ( [4] => Array ( [id] => 4 [name] => ------aa [parent_id] => 3 [level] => 3 [children] => Array ( [6] => Array ( [id] => 6 [name] => --------aaa [parent_id] => 4 [level] => 4 [children] => Array ( ) ) ) ) ) ) ) ) [1] => Array ( [id] => 2 [name] => --B [parent_id] => 0 [children] => Array ( [5] => Array ( [id] => 5 [name] => ----b [parent_id] => 2 [level] => 2 [children] => Array ( ) ) ) ) ) |
2
hanyouchun66 2016-08-02 17:49:39 +08:00
能
|
3
invoke 2016-08-03 22:38:18 +08:00
foreach 然后递归不就可以了吗
|