Date: 05/09/00
- Next message: bonywine <email protected>: "[PHP-DEV] Bug #4355: parse error before 'off_t'"
- Previous message: tswan <email protected>: "[PHP-DEV] PHP 4.0 Bug #4362: Set an include_path from script"
- In reply to: Kasper Skårhø: "[PHP-DEV] Array-sorting acting strangely??"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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>
- Next message: bonywine <email protected>: "[PHP-DEV] Bug #4355: parse error before 'off_t'"
- Previous message: tswan <email protected>: "[PHP-DEV] PHP 4.0 Bug #4362: Set an include_path from script"
- In reply to: Kasper Skårhø: "[PHP-DEV] Array-sorting acting strangely??"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

