PHP » array_reverse
Return an array with elements in reverse order
array_flip() - Exchanges all keys with their associated values in an array
| Parameters | Description |
|---|---|
| array | The input array. |
| preserve_keys | If set to TRUE keys are preserved. |
Example
<?php
$input = array("php", 4.0, array("green", "red"));
$result = array_reverse($input);
$result_keyed = array_reverse($input, true);
?>The above example will output something similar to:
Array
(
[0] => Array
(
[0] => green
[1] => red
)
[1] => 4
[2] => php
)
Array
(
[2] => Array
(
[0] => green
[1] => red
)
[1] =>

