Results 1 to 3 of 3

Thread: [RESOLVED] sort array elements by strlen() descending

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2004
    Posts
    121

    Resolved [RESOLVED] sort array elements by strlen() descending

    Hello all.
    Could anyone tell me how to sort the elements of an array according the the length of each element, in descending order?
    Code:
    $search_string='Hello this the content of a querystring.';
    
    $keywords=split(' ',$search_string);
    So that the result would go something like:
    Code:
    querystring.
    content
    hello
    this
    the
    of
    a
    usort() perhaps?
    Much appreciated.
    Last edited by solitario; Dec 12th, 2006 at 09:26 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width