如何使用 set combine 制作关联数组?
我已经设法通过合并来创建一个带有索引的数组,我只是 foreach troughout 结果并将所有 3 个数组合并为一个,但这不是关联数组,我可以用组合来做吗?
例子 :
Array
(
[0] => Array
(
[0] => Array
(
[Year] => 2003
[Month] => June
[MyCount] => 1
)
[MyData1] => Array
(
[type] => 10
)
[MyData2] => Array
(
[status] => 1
)
)
[1] => Array
(
[0] => Array
(
[Year] => 2003
[Month] => June
[MyCount] => 32
)
[MyData1] => Array
(
[type] => 7
)
[MyData2] => Array
(
[status] => 21
)
)
)
我怎样才能让它变成这样:
Array
(
[0] => Array
(
['SomeName'] => Array
(
[Year] => 2003
[Month] => June
[MyCount] => 1
[type] => 10
[status] => 1
)
)
[1] => Array
(
['SomeName'] => Array
(
[Year] => 2003
[Month] => June
[MyCount] => 32
[type] => 7
[status] => 21
)
)
)