Counting arrays in loop
- by Ivory Santos
I have a loop...
while($rows=mysql_fetch_array($result))
{
$staff[] = $rows['staff'];
$a = array_count_values($staff);
$b = count($a);
echo"$b<br>";
}
that output
1
1
1
2
2
2
3
3
4
5
5
on my research, it must be and I wanted the result to be this way
3 (is equal to three 1's)
3 (is equal to three 2's)
2 (is equal to two 3)
1 (is equal to one 4)
2 (is equal to two 5's)
any help?
what I want is to get the number of same element in an array