php sort array preserve keys code example
Example 1: php rsort retain keys
//Sort an array in reverse order and maintain index association
arsort($myArray)
Example 2: php sort array remove keys
$arr = array(1, 2, 3);
unset($arr[0]);
$arr = array_values($arr);
print_r($arr);
//Array ( [0] => 2 [1] => 3 )