September 2001
Intermediate to advanced
768 pages
32h 45m
English
bool uksort(array array, string func)
| array | Array to sort using the supplied function |
| func | Function with which to sort the array keys |
Sorts the elements of an array by keys, using a user-defined function.
Returns:
TRUE on success; FALSE on failure
Description:
uksort() sorts array based on the keys, preserving the key/value relationships. The keys are sorted using a bubblesort algorithm, which uses the user-defined comparison function named by func to evaluate whether the two elements being compared are equivalent, the first is greater than the second, or the second is greater than the first. This function can be used to modify the order in which keys are sorted, rather than using the standard order supplied with ksort(). For example, ...
Read now
Unlock full access