I have an array of 200 items. I would like to output the array but group the items with a common value. Similar to SQL\'s GROUP BY method. This should be relatively easy to
Here's a quick example:
$a = array(1, 2, 3, 1, 2, 3, 3, 2, 3, 2, 3, 4, 4, 1); $n = array_count_values($a); arsort($n);
print_r($n); Array ( [3] => 5 [2] => 4 [1] => 3 [4] => 2 )
print_r($n);
Array ( [3] => 5 [2] => 4 [1] => 3 [4] => 2 )