求数组重组代码解决办法
程序员文章站
2024-01-30 17:35:10
...
求数组重组代码
我现在有一个数组如下:
[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(
我现在有一个数组如下:
[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(
相关文章
相关视频
上一篇: [原创]php批量替换Excel文件内容