I have the array
Array ( [0] => Array ( [field_yourrating_rating] => 100 ) [1] => Array ( [field_yourrating_rating] => 80 ) [2] => Array ( [field_yourrating_rating] => 100 ) )
I want to be able to count the number of occurences of each value – for exmaple, 100 appears 1 time, and 80 appears one time.
I tried using array_count_values but it doesn’t seem to work with a multidimensional array! What else can I try?
If the array is only ever structured as it is in your example then this will work:
And then
$countwill be an array where the keys are the values of the input array and the values are the number of times they occur.