1$array= array(1,2,3,4,5);
2$reversedArray = array_reverse($array);
3
4var_dump($y);
1foreach(array_reverse($array) as $var) {
2 echo $var // Will show in reversed order
3}
1
2<?php
3$input = array("php", 4.0, array("green", "red"));
4$reversed = array_reverse($input);
5$preserved = array_reverse($input, true);
6
7print_r($input);
8print_r($reversed);
9print_r($preserved);
10?>
11
12
1<?php
2$i_arr = ["html", "css", "javascript", "php", "vue", "react"];
3
4echo "<pre>";
5print_r($i_arr);
6echo "</pre>";
7
8$reverse = array_reverse($i_arr, false);
9$preserve = array_reverse($i_arr, true);
10
11echo "<pre>";
12print_r($reverse);
13echo "</pre>";
14
15echo "<pre>";
16print_r($preserve);
17echo "</pre>";
18?>