Home  >  Article  >  Backend Development  >  求数组重组代码解决办法

求数组重组代码解决办法

WBOY
WBOYOriginal
2016-06-13 12:37:42862browse

求数组重组代码
我现在有一个数组如下:
[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(

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn