Russell P Jones wrote:
> Any idea how to sort an array by string length?

Use usort() in conjunction with a user defined function that compares the 
length of
both strings using strlen().  If brevity at the (possible) expense of clarity is
your thing, you can even use create_function() as your callback argument to 
usort()
to make this a one-liner.  Of course if that were your sort of thing you'd 
probably
be using perl instead of PHP. :)

HTH

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to