PHP Reverse Array
$array= array(1,2,3,4,5);
$reversedArray = array_reverse($array);
var_dump($y);
Annoyed Albatross
$array= array(1,2,3,4,5);
$reversedArray = array_reverse($array);
var_dump($y);
<?php
$input = array("oranges", "apples", "pears");
$flipped = array_flip($input);
print_r($flipped);
$input = array("a" => 1, "b" => 1, "c" => 2);
$flipped = array_flip($input);
print_r($flipped);
# Output
Array
(
[1] => b
[2] => c
)
<?php
$i_arr = ["html", "css", "javascript", "php", "vue", "react"];
echo "<pre>";
print_r($i_arr);
echo "</pre>";
$reverse = array_reverse($i_arr, false);
$preserve = array_reverse($i_arr, true);
echo "<pre>";
print_r($reverse);
echo "</pre>";
echo "<pre>";
print_r($preserve);
echo "</pre>";
?>
<?php
$input = array("oranges", "apples", "pears");
$flipped = array_flip($input);
print_r($flipped);
?>