0
如何將以下格式的少數數組合併成一個數組。合併PHP數組
謝謝。
Array
(
[apple] => 1
[mango] => 5
[banana] => 3
)
Array
(
[car] => 2
[bus] => 7
[moto] => 8
)
Array
(
[rain] => 14
[snow] => 7
[sun] => 12
)
新陣列
Array
(
[0] => Array
(
[apple] => 1
[mango] => 5
[banana] => 3
)
[1] => Array
(
[car] => 2
[bus] => 7
[moto] => 8
)
[2] => Array
(
[rain] => 14
[snow] => 7
[sun] => 12
)
)
array_merge:http://php.net/manual/en/ function.array-merge.php – malletjo
@racar不適用於想要的結果 – Phil
我同意,array_merge(array($ array1),array($ array2)...)不是一個很好的方法來做到這一點 – malletjo