I would like to group id so as to have an id count. here is my code
<?php
while($row = $res->fetch_assoc()) {
$records[] = $row;
}
foreach($records as $row){
echo $row['id'] ."<br>";
}
?>
outpout :
1
2
3
4
4
4
5
i want
1
2
3
4 (3)
5
how can I do?
thank you very much for the help
array_count_values
: php.net/manual/en/function.array-count-values.php – Brett Gregson Sep 16 '19 at 13:35