uasort()
uasort - Sort an array with a user-defined comparison function and maintain index association
Syntax
bool uasort (
array &$array,
callback $cmp_function)
Arguments
- array - The input array.
- cmp_function - See usort() and uksort() for examples of user-defined comparison functions.
Description
This function sorts an array such that array indices maintain their correlation with the array elements they are associated with, using a user-defined comparison function.
Version
PHP 4, 5
Return value
Returns TRUE on success or FALSE on failure.