Re: [PHP-DEV] Array-sorting acting strangely?? From: Andrei Zmievski (andrei <email protected>)
Date: 05/09/00

On Tue, 09 May 2000, Kasper Skårhøj wrote:
> Sorting an array with values of mixed types (strings and integers) results in something which doesn't seem to be a sorted list of the values!
>
> In my particular case I have an array where the keys are associative and a mix of strings and integers. When I sort the array (ksort) the keys are not sorted correctly in any way. If I sort it again it's even differently sorted!
>
> Try the attached script.

Everything is being sorted just the way it's supposed to be. "10." is a
string key which is less than 10 (numeric key), so it comes earlier in
the list.

-Andrei
* E Pluribus UNIX. *

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>