我需要在发布数组后找到并计算重复值
foreach ($_POST["marks"] as $marks => $value) {
need to display duplicate values and their count here
}
请帮助
答案 0 :(得分:-1)
http://us2.php.net/manual/en/function.array-count-values.php
<?php
$array = array(1, "hello", 1, "world", "hello");
print_r(array_count_values($array));
?>
输出
Array
(
[1] => 2
[hello] => 2
[world] => 1
)