Previous | Home | Next |
array_reverse()
The array_reverse() function returns an array in the reverse order.
Syntax:array_reverse(array,preserve)
In above syntax, "array" specifies an array and "preserve" specifies if the function should preserve the keys of the array or not and key values are as follows:
- true
- false
Example:
<?php $arr=array("a"=>"Apple","b"=>"Mango","c"=>"Banana"); print_r(array_reverse($arr)); ?>
Output:
Previous | Home | Next |