Описание тега usort
NoneA function in PHP which provides means for custom collections sorting by using an user-defined comparison function to determine the order of elements
bool usort ( array &$array , callable $cmp_function )
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.