Name

sort

Synopsis

void sort(array array[, int flags])

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:

SORT_REGULAR (default)

Compare the items normally.

SORT_NUMERIC

Compare the items numerically.

SORT_STRING

Compare the items as strings.

See Chapter 5 for more information on using this function.

Get Programming PHP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.