我需要在 PHP 中合并一个二维和关联数组有一点问题。
所以我想要实现的输出是这样的:
Array ( [0] => 6 [1] => 5 [2] => 9 [3] => 8 [4] => 3 [5] => 16 [6] => 55
[7] => 59 [8] => 56 [9] => 3 [10] => 4 .... [1293] => 2)
目前我的输出如下:
foreach ($arrayList as $key => $list) {
print_r($list);
}
是
Array ( [hgeneral1] => 6 [hgeneral2] => 5 [hgeneral3] => 9 [hgeneral4] => 8
[hgeneral5] => 3 [hgeneral6] => 16 [hmusic1] => 55 [hmusic2] => 59 [hmusic3] => 56 )
Array ( [hgeneral1] => 3 [hgeneral2] => 4 [hgeneral3] => 8 [hgeneral4] => 10 [hgeneral5]
=> 16 [hgeneral6] => 17 [hsport1] => 26 [hsport2] => 32 [hsport3] => 35 [hsport4] => 38
[hsport5] => 41 [hsport6] => 42 [hmusic1] => 55 [hmusic2] => 56 [hmusic3] => 58
[hmusic4] => 60 [hmusic5] => 61 ) Array ....
和 50 多个数组一样。
现在因为它是一个关联数组合并只会覆盖值(如果我理解正确的话),所以我的问题是:有没有办法将所有这些值放入一个大数组中?
我真的很感激任何帮助,并为我的英语不好(以及可能有点愚蠢的问题,但我对编程真的很陌生)感到抱歉。
干杯
判断