我想在关联数组中获取重复值的数量(array['name']
),同时我需要从中删除这些重复值。
实际数组:
[0] => Array
(
[user_id] => 123
[name] => hello
)
[1] => Array
(
[user_id] => 124
[name] => hello
)
[2] => Array
(
[user_id] => 125
[name] => hello1
)
预期:
[0] => Array
(
[user_id] => 123
[name] => hello
[name_count] => 2
)
[1] => Array
(
[user_id] => 125
[name] => hello1
[name_count] => 1
)
有没有办法实现这个目标?