我正在研究一个多维数组。我如何按价值分组?在下面的数组[0] [1]中有相同的group_id。在这种情况下,我想将这些组合在一起。
Array
(
[0] => stdClass Object
(
[id] => 142
[city_name] => Abhayapuri
[state_id] => 4
[group_id] => 2
)
[1] => stdClass Object
(
[id] => 494
[city_name] => Achabbal
[state_id] => 15
[group_id] => 2
)
[2] => stdClass Object
(
[id] => 1302
[city_name] => Achhnera
[state_id] => 34
[group_id] => 1
)
)
有没有办法实现它。