note 55507 added to function.natsort
| From: | natcasesort dot too at osu1 dot php dot net | Date: | Fri, 05 Aug 2005 10:17:40 +0000 |
| Subject: | note 55507 added to function.natsort | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-93120@lists.php.net to get a copy of this message | ||
I got caught out through naive use of this feature - attempting to sort a list of image filenames
from a digital camera, where the filenames are leading zero padded (e.g. DSCF0120.jpg) , will not
sort correctly.
Maybe the example could be modified to exhibit this behaviour
(e.g. set array to -img0120.jpg','IMG0.png', 'img0012.png',
'img10.png', 'img2.png', 'img1.png', 'IMG3.png)
If the example hadn't used images I would have coded it correctly first time around!
----
Manual Page -- http://www.php.net/manual/en/function.natsort.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+55507
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55507&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55507&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55507&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55507&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55507&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55507&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+55507&report=yes
Search -- http://master.php.net/manage/user-notes.php