I'm working on a multidimensional array. How can i group it by value ? In the following array [0][1] have same group_id. In this case i want to group these together.
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
)
)
Is there any way to achieve it.