note 119216 deleted from function.usort by mazzanet
| From: | mazzanet@php.net | Date: | Thu, 21 Apr 2016 09:21:04 +0000 |
| Subject: | note 119216 deleted from function.usort by mazzanet | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-205295@lists.php.net to get a copy of this message | ||
Note Submitter: randomUser
----
it seems the sorting function doesn't have to return either 0, 1, and -1. It will treat any
positive number at 1 and any negative number as -1. So you won't need to write if else
statements you can just return one value minus the other one.