I've hit a brick wall with the a script i'm making. Say I have an array with the values ball,doll,cat,cat,dog,cat,ball,cat. Is there a way to sort the array in order of the most common value inside the array. I know that array_count_values can count the number of a certain value in an array. So mayby I could run a loop to go through the array and count how many of each value are the array then put it into something with the value and the number of recurrences of the value then sort them that way? Is there a much quicker way? Any help appreciated