I need to find and count duplicate values after post the array
foreach ($_POST["marks"] as $marks => $value) {
need to display duplicate values and their count here
}
please help
I need to find and count duplicate values after post the array
foreach ($_POST["marks"] as $marks => $value) {
need to display duplicate values and their count here
}
please help
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));
?>
output
Array
(
[1] => 2
[hello] => 2
[world] => 1
)