如何以這種方式組合數組?合併數組(PHP)
來源:
Array
(
[0] => Array
(
[id] => 3
[title] => book
[tval] => 10000
)
[1] => Array
(
[id] => 3
[title] => book
[tval] => 1700
)
[3] => Array
(
[id] => 27
[title] => fruit
[tval] => 3000
)
.......
)
結果:
Array
(
[0] => Array
(
[id] => 3
[title] => book
[tval] => 10000,1700
)
[1] => Array
(
[id] => 27
[title] => fruit
[tval] => 3000
)
.......
)
請幫忙解決這個問題, 謝謝! 抱歉不好英語(
嘗試`array_walk()`http://php.net/manual/en/function.array-walk.php – 2011-01-30 13:53:19
請使用`var_export`而不是`print_r` – arnaud576875 2011-01-30 13:59:18