Ordering PHP array by number of identical objects.

Posted by iMaster on Stack Overflow See other posts from Stack Overflow or by iMaster
Published on 2010-05-02T20:41:34Z Indexed on 2010/05/02 20:47 UTC
Read the original article Hit count: 307

Filed under:
|
|

Is there anyway to order an array in this way? For example if I had this array:

$array = array("foo", "bar", "item", "item", "foo", "foo");

And I wanted to order it so that it was "foo", "foo", "foo", "item", "item", "bar" is there any way to do that?

© Stack Overflow or respective owner

Related posts about php

Related posts about array