note 87706 added to function.natsort
| From: | wyvernatgreywyverndotcom at osu1 dot php dot net | Date: | Wed, 17 Dec 2008 18:53:28 +0000 |
| Subject: | note 87706 added to function.natsort | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-148275@lists.php.net to get a copy of this message | ||
There's no need to include your own API code to natsort an associative array by key.
PHP's in-built functions (other than natsort) can do the job just fine:
<?php
uksort($myArray, "strnatcmp");
?>
----
Server IP: 216.235.15.211
Probable Submitter: 204.187.63.106
----
Manual Page -- http://www.php.net/manual/en/function.natsort.php
Edit -- https://master.php.net/note/edit/87706
Del: integrated -- https://master.php.net/note/delete/87706/integrated
Del: useless -- https://master.php.net/note/delete/87706/useless
Del: bad code -- https://master.php.net/note/delete/87706/bad+code
Del: spam -- https://master.php.net/note/delete/87706/spam
Del: non-english -- https://master.php.net/note/delete/87706/non-english
Del: in docs -- https://master.php.net/note/delete/87706/in+docs
Del: other reasons-- https://master.php.net/note/delete/87706
Reject -- https://master.php.net/note/reject/87706
Search -- https://master.php.net/manage/user-notes.php