(PHP 4 >= 4.0.0)
array_reverse -- Return an array with elements in reverse orderarray_reverse() takes input array and returns a new array with the order of the elements reversed, preserving the keys if preserve_keys is TRUE.
Example 1. array_reverse() example
This makes both $result and $result_keyed have the same elements, but note the difference between the keys. The printout of $result and $result_keyed will be:
|
Note: The second parameter was added in PHP 4.0.3.