Maison > Article > développement back-end > 求数组重组代码解决办法
求数组重组代码
我现在有一个数组如下:
[0] => Array
(
[size] => 123
[path] => Array
(
[0] => a
[1] => b
[2] => c
[3] => abc
)
)
[1] => Array
(
[size] => 456
[path] => Array
(
[0] => d
[1] => e
[2] => f
[3] => def
)
)
想重组成如下数组样式,请问怎么写代码啊?
[0] => Array
(
[a] => Array(
[b] => Array(
[c] => Array(
[size] => '123',
[name] => 'abc'
)
)
)
)
[1] => Array
(
[d] => Array(