php arrayValue range 90 150 arrayKey range 150 90 -3 array array_combi

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
<?php
$arrayValue = range(90,150,3);
$arrayKey = range(150,90,-3);
$array = array_combine ($arrayKey,$arrayValue);
foreach ($array as $key => $value){
echo $key . " - " . $value . "<br>";
}
$arrayTwo = $array;
ksort($array);
foreach ($array as $key => $value){
echo $key . " - " . $value . "<br>";
}