usort

usort

(PHP 4, PHP 5, PHP 7)

usortSort an array by values using a user-defined comparison function

Description

bool usort ( array &$array , callable $value_compare_func )

This function will sort an array by its values using a user-supplied comparison function. If the array you wish to sort needs to be sorted by some non-trivial criteria, you should use this function.

Note:

If two members compare as equal, their relative order in the sorted array is undefined.

Note