开发者

Pulling information from array_count_values

开发者 https://www.devze.com 2023-02-04 05:16 出处:网络
I am using array_count_values and I want to pull any key that has a v开发者_开发问答alue greater than > 4 and put in a new array.Is there a way to do this?foreach(array_count_values($the_array) as $ke

I am using array_count_values and I want to pull any key that has a v开发者_开发问答alue greater than > 4 and put in a new array. Is there a way to do this?


foreach(array_count_values($the_array) as $key=>$value){
    if ($value > 4){
        echo $key;
    }
}


using the array_filter() function might be a good place to start.

0

精彩评论

暂无评论...
验证码 换一张
取 消