$array = array(3,5,2,8);
Applicable sort functions:
sort
rsort
asort
arsort
natsort
natcasesort
ksort
krsort
The difference between those is merely whether key-value associations are kept (the "a
" functions), whether it sorts low-to-high or reverse ("r
"), whether it sorts values or keys ("k
") and how it compares values ("nat
" vs. normal). See http://php.net/manual/en/array.sorting.php for an overview and links to further details.