Array-sorting acting strangely??
| From: | Kasper Skårhøj | Date: | Tue, 09 May 2000 21:34:43 +0000 |
| Subject: | Array-sorting acting strangely?? | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-18546@lists.php.net to get a copy of this message | ||
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.
Guds fred ;-)
Kasper
--------------------- o ------------------------
www.typo3.dk
Attachment: [application/octet-stream] arraysort-bug.php3
Attachment: [application/octet-stream] arraysort-bug.php3