How to use array reverse in PHP
In this article, I will explain how the array_reverse() function can be used in PHP.
array_reverse() function in PHP
The array_reverse() function is used to returns an array in the reverse order.
Syntax
array_reverse(array,preserve) |
Parameter
Example
The following example show to how the array_reverse() function can be used in PHP.
<html>
<body>
<h3 style="color: blue;">array_reverse() function example in PHP</h3>
<?php
$a= array(1,2,3,4,5);
$x = array_reverse($a);
echo "Current Array value </br>";
print_r($a);
echo "</br> After reverse function value<br/>";
print_r($x);
?>
</body>
</html>
|
Output
You may also want to read these related articles here
Ask Your Question
Got a programming related question? You may want to post your question here