$arr = [
[
'id' => 1,
'children' => [
'id' => 2,
'children' => [
'id' => 3,
'children' => [
'id' => 4
]
]
]
],
[
'id' => 5,
'children' => [
'id' => 6,
]
],
[
'id' => 7
]
];
存在children数组则将children数组里的id赋值给新的数组,最终组成新的数组如下:
$arr2 = [
[1,2,3,4],
[5,6],
[7]
];
料青山看我应如是
鸿蒙传说