array_reverse
Return an array with elements in reverse order
Description
arrayarray_reverse
arrayarray
boolpreserve_keys
array_reverse takes input
array and returns a new array with the
order of the elements reversed, preserving the keys if
preserve_keys is &true;.
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:
Array
(
[0] => green
[1] => red
)
[1] => 4
[2] => php
)
Array
(
[2] => Array
(
[0] => green
[1] => red
)
[1] => 4
[0] => php
)
]]>
The second parameter was added in PHP 4.0.3.