sort aray by element length

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Is there a function to sort an array by the length of the element?

Such as:

$array = array(


 '1' => 'a',
 '2' => 'if',
 '3' => 'the',


Re: sort aray by element length wrote:

Quoted text here. Click to load it

No, but you can use array_usort().

Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

El amor abre el paréntesis, el matrimonio lo cierra.- Victor Hugo.

Site Timeline