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