我有一個數組,目前看起來像這樣:PHP更改陣列結構/格式
Array
(
[0] => Array
(
[language] => English
)
[1] => Array
(
[language] => Arabic
)
[2] => Array
(
[language] => Bengali
)
)
我想要做的是改變它,所以它看起來是這樣的:
Array
(
[language] => Array
(
[0] => English
[1] => Arabic
[2] => Bengali
)
)
我也有一個數組,看起來像這樣:
Array
(
[id] => 3
[name] => lethalMango
[joined] => 2010-01-01 00:00:00
)
,我想將它更改爲:
Array
(
[user] => Array
(
[id] => 3
[name] => lethalMango
[joined] => 2010-01-01 00:00:00
)
)
我已經嘗試了多種方法沒有太大的成功,但我敢肯定有一個更有效的方式。
很難比較我們與您的代碼提案的效率因爲你不與我們分享... – 2011-05-11 09:49:46