php sort array by number code example
Example 1: php sort hight to low
$letters=array("b","a","c");
arsort($letters); //referse sort an array ("c","a","b")
Example 2: php rearrange array
function rearrange_array($array, $key) {
while ($key > 0) {
$temp = array_shift($array);
$array[] = $temp;
$key--;
}
return $array;
}