php统计数组的每个值的个数
$arr = [1, 2, 3, 4, 5, 1, 2, 3];
$count = array_count_values($arr);
// 输出结果
[
1 => 2,
2 => 2,
3 => 2,
4 => 1,
5 => 1
]
$arr = [1, 2, 3, 4, 5, 1, 2, 3];
$count = array_count_values($arr);
// 输出结果
[
1 => 2,
2 => 2,
3 => 2,
4 => 1,
5 => 1
]