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

求数组重组代码解决办法

WBOY
Release: 2016-06-13 12:37:42
Original
891 people have browsed it

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template