Array_reverse in php example

The array_reverse() is used to reverse the array values.

Syntax:

array_reverse($array);

Program: array_reverse.php

<?php
$words = $argv;
echo "original\n";
print_r($words);
echo "after reverse\n";
$words = array_reverse($words);
print_r($words);
?>

Output:

array_reverse output

 

 

Thanks for reading this post…………..!!!

Leave a Reply