array_reverse

(PHP4 >= 4.0b4)

array_reverse --  Return an array with elements in reverse order

Description

array array_reverse (array array)

Array_reverse() takes input array and returns a new array with the order of the elements reversed.

Example 1. Array_reverse() example


$input = array ("php", 4.0, array ("green", "red"));
$result = array_reverse ($input);
      

This makes $result have array (array ("green", "red"), 4.0, "php").