I have a php array with mixed types like this :
$length = array (15, 3, 5, '-');
and I want to sort it to obtain a list of values sorted like this : '-', 3, 5, 15
How can I do that ?
Thanks a lot.
Well, When using various mixed type in an array , you would need to set your own "priorities" of whats first and whats last.
You could use PHP's usort function to define your own function to sort the array and define your own priorities for each data type or value.
Shai.
You have to use usort, because PHP's sort function is not stable. See http://quaxio.com/wtf/php.html#turtle17