我有一个数组:
Array
(
[0] => Array
(
[attribute_name] => Appliances
[attribute_value] => Washer
)
[1] => Array
(
[attribute_name] => Appliances
[attribute_value] => Dryer
)
[2] => Array
(
[attribute_name] => Appliances
[attribute_value] => Dishwasher
)
[3] => Array
(
[attribute_name] => Appliances
[attribute_value] => Microwave
)
[4] => Array
(
[attribute_name] => Console
[attribute_value] => Xbox360
)
[5] => Array
(
[attribute_name] => Console
[attribute_value] => PS3
)
)
我想生产:
Array
(
[0] => Array
(
[attribute_name] => Appliances
[attribute_value] => Washer, Dryer, Dishwasher, Microwave
)
[1] => Array
(
[attribute_name] => Console
[attribute_value] => Xbox360, PS3
)
)
这是如何在 PHP 中实现的?
这是我基于@andrewtweber 的原始解决方案的最终代码: