What is the function array_reverse() used for in PHP?
The array_reverse() function in PHP is used to reverse the order of elements in an array. This can be useful when you need to display an array in reverse order or manipulate the elements in a different way. By using array_reverse(), you can easily reverse the order of elements in an array without having to manually rearrange them.
// Example usage of array_reverse()
$originalArray = array(1, 2, 3, 4, 5);
$reversedArray = array_reverse($originalArray);
// Output the reversed array
print_r($reversedArray);