note 63798 added to function.natsort
| From: | Juokelis at osu1 dot php dot net | Date: | Fri, 31 Mar 2006 07:54:07 +0000 |
| Subject: | note 63798 added to function.natsort | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-107061@lists.php.net to get a copy of this message | ||
Hello, I haven't founf function to sort keys in "natural order", so may be someone
will find this useful:
<?
function natksort ( $arrayIn ) {
$arrayOut = array ();
$arrayTemp = array ();
$arrayTemp = array_keys( $arrayIn );
natsort ( $arrayTemp );
foreach ( $arrayTemp as $key ) {
$arrayOut[$key] = $arrayIn[$key];
}
return $arrayOut;
}
?>
----
Server IP: 193.219.81.76
Probable Submitter: 213.197.139.102
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.natsort.php
Edit -- http://master.php.net/note/edit/63798
Del: integrated -- http://master.php.net/note/delete/63798/integrated
Del: useless -- http://master.php.net/note/delete/63798/useless
Del: bad code -- http://master.php.net/note/delete/63798/bad+code
Del: spam -- http://master.php.net/note/delete/63798/spam
Del: non-english -- http://master.php.net/note/delete/63798/non-english
Del: in docs -- http://master.php.net/note/delete/63798/in+docs
Del: other reasons-- http://master.php.net/note/delete/63798
Reject -- http://master.php.net/note/reject/63798
Search -- http://master.php.net/manage/user-notes.php