我有一个这样的数组,我希望它的总和如下所述:
Array
(
[0] => stdClass Object
(
[id] => 1
[group] => 1
)
[1] => stdClass Object
(
[id] => 2
[group] => 2
)
[2] => stdClass Object
(
[id] => 3
[group] => 2
)
[3] => stdClass Object
(
[id] => 4
[group] => 3
)
[4] => stdClass Object
(
[id] => 5
[group] => 3
)
[5] => stdClass Object
(
[id] => 6
[group] => 3
)
)
我希望结果显示如下:
第 1 组有 1 个成员。第 2 组有 2 个成员。第 3 组有 3 名成员。