September 2001
Intermediate to advanced
768 pages
32h 45m
English
bool uasort(array array, string func)
| array | Array to be sorted |
| func | Function to use for sorting |
Sorts an array by value with a user-defined function.
Returns:
TRUE on success; FALSE on failure
Description:
uasort() sorts array by the value of each element, using the specified user-defined function named by func . Key/value relationships are preserved. This function is useful if the values of an associative array must be in some specific non-regular order, such as when you want to do a non-case-sensitive sort with both uppercase and lowercase alphabets.
func should be written to accept two parameters, which it must compare with each other. If they’re considered equivalent, 0 should be returned. If the first is considered to be greater, ...
Read now
Unlock full access