下面是我的数组示例。每次 user_id 在数组中时,我都会尝试计算。每次 user_id 在数组中时,我都会尝试计算。
Array
(
[0] => Array
(
[user_id] => 57002892
[page_id] => 109446562415595
)
[1] => Array
(
[user_id] => 515576073
[page_id] => 109446562415595
)
[2] => Array
(
[user_id] => 560299932
[page_id] => 109446562415595
)
[3] => Array
(
[user_id] => 607960053
[page_id] => 109446562415595
)
[4] => Array
(
[user_id] => 607960053
[page_id] => 109446562415595
)
)
这应该输出以下内容:
Array
(
[0] => Array
(
[user_id] => 57002892
[count] => 1
)
[1] => Array
(
[user_id] => 515576073
[count] => 1
)
[2] => Array
(
[user_id] => 560299932
[count] => 1
)
[3] => Array
(
[user_id] => 607960053
[count] => 2
)
)
这可能吗?