arsort

bool arsort(array array, [int flag]) 
array Array to be sorted
flag Flag specifying how to compare element values (PHP 4.0.0+ only)

Sorts the given array in descending order by element value.

Returns:

TRUE on success; FALSE on error

Description:

Sorts the elements of the array given by array in descending order by element value while maintaining the key/value associations. This function differs from rsort() in that it works with both associative and indexed arrays.

This function operates directly on the passed array.

After calling arsort(), the internal array pointer is on the first element of array .

(PHP 4.0.0+ only) The way in which element values are compared can be modified by passing one of the following named constants as ...

Get PHP Functions Essential Reference 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.