note 118737 deleted from function.sort by cmb
| From: | cmb@php.net | Date: | Sun, 27 Oct 2019 08:33:42 +0000 |
| Subject: | note 118737 deleted from function.sort by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-212787@lists.php.net to get a copy of this message | ||
Note Submitter: totszwai at gail dot com
----
For those who wanna go with simple approach without hammering your head too much... This does the
job, granted might not be efficient, but is really short. :P
Let $all be a key/value paired array...
$keys = array_keys($all);
sort($keys);
$sorted = array();
foreach($keys as $k) {
$sorted[$k] = $all[$k];
}
$all = $sorted;
unset($sorted);