October 2006
Intermediate to advanced
720 pages
17h 56m
English
Arrays are lists, and you will sort them differently, depending on the end-user requirements. PHP provides a library of predefined functions to sort arrays, as shown in Table 6-4. You will review the function definitions before examining each in depth.
| Function | Description and Pattern |
|---|---|
| arsort() | The function takes two formal parameters: the first is an array, and the second is a sorting flag. It sorts in reverse or descending order, preserving the native keys of the original array, and has this pattern:
void arsort(array var [, int sort_flag]) |
| asort() | The function takes two formal parameters: the first is an array, and the second is a sorting flag. It sorts in ascending order, preserving the native ... |
Read now
Unlock full access