September 2001
Intermediate to advanced
768 pages
32h 45m
English
void asort(array array, [int flag])
| array | Array to be sorted |
| flag | Flag specifying how to compare element values (PHP 4.0.0+ only) |
Sorts the given array in ascending order.
Returns:
Nothing
Description:
Sorts the elements of the array given by array in ascending order by element value while maintaining the key/value associations. This function differs from sort() in that it works with both associative and indexed arrays; the a in asort() stands for associative.
This function operates directly on the passed array.
After calling asort(), the internal array pointer is on the first element of array .
(PHP 4.0.0+ only) The way in which element values are compared can be modified by passing one of the following named constants as flag : ...
Read now
Unlock full access