Pulling information from array_count_values

I am using array_count_values ​​and I want to pull out any key that has a value greater than> 4 and places in a new array. Is there any way to do this?

+4
source share
2 answers
foreach(array_count_values($the_array) as $key=>$value){ if ($value > 4){ echo $key; } } 
+3
source

using array_filter () might be a good start.

+1
source

Source: https://habr.com/ru/post/1335394/


All Articles