现有数组
array (size=7)
0 =>
array (
'text' => '11',
'dept_id' => '48a1ad22697c46e094c564472644d86f',
'parent' => '094ebff314f14f9c9356a8da7d736dd5' )
1 =>
array (
'text' => '1111' ,
'dept_id' => 'e58393f0a16a448db837e2d3bd423629' ,
'parent' => '48a1ad22697c46e094c564472644d86f'
)
希望遍历后得出的目标数组
array (
'text' => '11' ,
'dept_id' => '48a1ad22697c46e094c564472644d86f' ,
'parent' => '094ebff314f14f9c9356a8da7d736dd5' ,
'children' =>
array (
'text' => '1111',
'dept_id' => 'e58393f0a16a448db837e2d3bd423629',
'parent' => '48a1ad22697c46e094c564472644d86f'
)
);
通过dept_id = parent 遍历然后拼接 请大神给个解决方案!!!感谢