I have an array, $arrayName = array(1,2,1,3,4,3,2,5);
. I want the result as:
Array (
[1] => 2
[2] => 2
[3] => 2
[4] => 1
[5] => 1
)
Without using array_count_values()
, what is the logic behind array_count_values()
?