Answers for "php array order last"

PHP
0

php array_reverse keep keys

<?php
$input  = array("php", 4.0, array("green", "red"));
$reversed = array_reverse($input);
$preserved = array_reverse($input, true);

print_r($input);
print_r($reversed);
print_r($preserved);
?>
Posted by: Guest on September-08-2020
1

php sort hight to low

$letters=array("b","a","c");
arsort($letters); //referse sort an array ("c","a","b")
Posted by: Guest on December-05-2020

Browse Popular Code Answers by Language