Possible Duplicate:
php: sort and count instances of words in a given string
I am looking to write a php function which takes a string as input, splits it into words and then returns an array of words sorted by the frequency of occurence of each word.
What's the most algorithmically efficient way of accomplishing this ?