我有一个这样的数组:D
Array
(
[0] => Array
(
[type] => AAA
[label_id] => A1,35
)
[1] => Array
(
[type] => AAA
[label_id] => A2,34
)
[2] => Array
(
[type] => BBB
[label_id] => B1,29
)
[3] => Array
(
[type] => CCC
[label_id] => C1,20
)
[4] => Array
(
[type] => CCC
[label_id] => C2,19
)
[5] => Array
(
[type] => CCC
[label_id] => C3,18
)
)
现在我想让它像这样按相同的键和值分组。
Array
(
[0] => Array
(
[type] => AAA
[label_id] => Array
(
[0] => A1,35
[1] => A2,34
)
)
[1] => Array
(
[type] => BBB
[label_id] => Array
(
[0] => B1,29
)
)
[2] => Array
(
[type] => CCC
[label_id] => Array
(
[0] => C1,20
[1] => C2,19
[2] => C3,18
)
)
)
有谁知道这是怎么做到的吗?