PHP обратный массив
$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
$input = array("oranges", "apples", "pears");
$flipped = array_flip($input);
print_r($flipped);
?>