note 102887 added to array.sorting
| From: | Anonymous at osu1 dot php dot net | Date: | Sat, 12 Mar 2011 17:56:20 +0000 |
| Subject: | note 102887 added to array.sorting | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-177822@lists.php.net to get a copy of this message | ||
Another way to do a case case-insensitive sort by key would simply be:
<?php
uksort($array, 'strcasecmp');
?>
Since strcasecmp is already predefined in php it saves you the trouble to actually write the
comparison function yourself.
----
Server IP: 69.147.83.197
Probable Submitter: 78.62.181.194
----
Manual Page -- http://www.php.net/manual/en/array.sorting.php
Edit -- https://master.php.net/note/edit/102887
Del: integrated -- https://master.php.net/note/delete/102887/integrated
Del: useless -- https://master.php.net/note/delete/102887/useless
Del: bad code -- https://master.php.net/note/delete/102887/bad+code
Del: spam -- https://master.php.net/note/delete/102887/spam
Del: non-english -- https://master.php.net/note/delete/102887/non-english
Del: in docs -- https://master.php.net/note/delete/102887/in+docs
Del: other reasons-- https://master.php.net/note/delete/102887
Reject -- https://master.php.net/note/reject/102887
Search -- https://master.php.net/manage/user-notes.php