Name
sort
Synopsis
bool sort(arrayarray[, intflags])
Sorts the values in the given array
in ascending order. For more control over the behavior of the sort,
provide the second parameter, which is one of the following
values:
| Compare the items normally. |
| Compare the items numerically. |
| Compare the items as strings. |
| Compare the items as strings using the current locale sorting rules. |
| Compare the items as strings using “natural ordering.” |
| Combine with |
Returns true if the operation
was successful, or false otherwise.
See Chapter 5 for more information on using this
function.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access