note 114430 modified in function.rsort by googleguy
| From: | googleguy@php.net | Date: | Thu, 20 Feb 2014 07:45:49 +0000 |
| Subject: | note 114430 modified in function.rsort by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-198557@lists.php.net to get a copy of this message | ||
If you are sorting an array from a database result set, such as MySQL for example, another approach
could be to have your database sort the result set by using ORDER BY DESC, which would be the
equivalent of using rsort() on the resulting array in PHP.
[Edited by moderator for clarity: googleguy at php dot net]
--was--
if u r using my sql u can do it simple by a DESC at the end of query. that will reverse array.
http://php.net/manual/en/function.rsort.php