Elle (elvishly) wrote in php,
Elle
elvishly
php

array_count_value

Hello,

Is it possible to rank array_count_value() in order of... count?

e.g.

$array = array(1,1,2,2,2,3);
array_count_value($array);

It would output, in this order: 2, 1, 3 because 2 has the highest frequency.

Thanks in advance!


SOLVED!
Subscribe
  • Post a new comment

    Error

    default userpic

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 3 comments

Deleted comment

Thank you!

I switched it to arsort() but it works perfectly.

Anonymous

February 15 2010, 09:14:14 UTC 8 years ago

y'know others in the community could learn from your question..

striking it out it is a wee bit unfriendly