| Ordering PHP Array by Word Count
|
NoLimits

msg:3660037 | 4:33 pm on May 27, 2008 (gmt 0) | I am trying to take the contents of a one dimensional php array and sort them in descending order, by the number of words in each string. eg... here is my current array array[0] = the dog was lazy array[1] = the lazy dog array[3] = wow that dog sure is lazy I would like it to re-order as follows: array[0] = wow that dog sure is lazy array[1] = the dog was lazy array[2] = the lazy dog Any assistance, greatly appreciated.
|
|