array_reverse

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

  1 
  2 $input = array ("php", 4.0, array ("green", "red"));
  3 $result = array_reverse ($input);
  4       
This makes $result have array (array ("green", "red"), 4.0, "php").

Note: This function was added in PHP 4.0 Beta 3.