note 20043 added to function.sort
| From: | steph at btinternet dot NO_SPAM dot com | Date: | Wed, 20 Mar 2002 15:11:34 +0000 |
| Subject: | note 20043 added to function.sort | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-27990@lists.php.net to get a copy of this message | ||
Single-element arrays can be case-insensitive sorted using:
usort($dir, create_function('$a,$b','return strcasecmp($a[0],$b[0]);'));
Richard Mitchell had this in place nearly a year ago, but it's hidden well. Hope bringing it
out into the open saves someone else an hour of frustration.
--
http://www.php.net/manual/en/function.sort.php
http://master.php.net/manage/user-notes.php?action=edit+20043
http://master.php.net/manage/user-notes.php?action=delete+20043
http://master.php.net/manage/user-notes.php?action=reject+20043