我有以下數組。如何將數組數組合併成一個php
Array
(
[0] => Array
(
[title] => IT Software - Application Programming, Maintenance
)
[1] => Array
(
[title] => IT Software - eCommerce, Internet Technologies
)
[2] => Array
(
[title] => IT Software - Client/ Server Programming
)
[3] => Array
(
[title] => IT Software - Other
)
)
想獲得的合成陣列如下
Array
(
[0] => IT Software - Application Programming, Maintenance
[1] => IT Software - eCommerce, Internet Technologies
[2] => IT Software - Client/ Server Programming
[3] => IT Software - Other
)
由於IM運行低於5.5的PHP版本,我可以得到比其他array_column()
一個簡單的襯墊。我試過$funcmerged = array_reduce($functionalres, 'array_merge', array());
但我沒有得到想要的結果。
如果你有PHP 5.5或更高版本,你也可以使用['array_column()'](http://php.net/manual/en/function.array-column.php) – Ghost
而不是「修復」這個,也許最好是首先創建數組,以便首先不包含每個元素的子數組? :) – Fluffeh
[將多維數組轉換爲一維數組]可能的副本(http://stackoverflow.com/questions/8611313/turning-multidimensional-array-into-one-dimensional-array) –