Say for example I have an array that looks like this:
$array = array(1, 2, 3, 4, 5);
And I have another array ($getreviewsarr) that contains this:
Array
(
[0] => Array
(
[beoordeling] => 4
)
[1] => Array
(
[beoordeling] => 4
)
[2] => Array
(
[beoordeling] => 5
)
[3] => Array
(
[beoordeling] => 4
)
[4] => Array
(
[beoordeling] => 5
)
[5] => Array
(
[beoordeling] => 5
)
)
How can I check how many times the 1 occurs and the 2 and the 3 etc.
So above example desired output would be:
1 - 0
2 - 0
3 - 0
4 - 3
5 - 3
I tried looping $getreviewsarr and using array_count_values on beoordeling but this doesn't show anything.
foreach($getreviewsarr as $occurence){
print_r(array_count_values($getreviewsarr['beoordeling']));
}