合并多维数组

时间:2013-02-16 07:50:42

标签: php multidimensional-array merge

我在PHP中有一个具有这种结构的数组:

Array
(
  [7] => Array
    (
      [6] => Array
        (
          [200000000] => Array
            (
              [201000001] => Array
                (
                  [201000002] => Entry
                  [201000003] => History
                  [201000004] => Statistic
                  [201000005] => Edit
                )

            )

        )

      [7] => Array
        (
          [200000000] => Array
            (
              [201000001] => Array
                (
                  [201000002] => Entry
                  [201000005] => Edit
                )

              [201000006] => Request
              [201000007] => Array
                (
                  [201000008] => Array
                    (
                      [201000009] => Inbox
                      [201000010] => Cancellation
                    )

                )

            )

        )

    )

)

如何将该数组转换为这样的数据:

Array
(
  [7] => Array
    (
      [6] => Array
        (
          [200000000] => Array
            (
              [201000001] => Array
                (
                  [201000002] => Entry
                  [201000003] => History
                  [201000004] => Statistic
                  [201000005] => Edit
                )

              [201000006] => Request
              [201000007] => Array
                (
                  [201000008] => Array
                    (
                      [201000009] => Inbox
                      [201000010] => Cancellation
                    )
                )
            )
        )
    )
)

如果有PHP内置函数可以做到这一点,是否优先?或者可能是一个没有太多循环的函数?

谢谢你......

0 个答案:

没有答案