← All built-ins / rsort()
rsort()
rsort(array &$a): bool
Parameters
| Name | Type | Description |
|---|---|---|
| $a | array | array to sort (by reference) |
Return value
true; sorted descending by value.
Example
$a = [3, 1, 2];
rsort($a);
echo implode(",", $a);3,2,1