Sometimes we need to get only the count of repeating elements from an array, or the count of each elements in an array
$array = array(123, 'abc', 26, 'swat', 1, 'swat', 83);
I would like to print:
123 (1)
abc (1)
26 (1)
swat (2)
1 (1)
83 (1)
use php function array_count_values
The output is: