I got the following php function, and want to change it into descending sorting, can someone help me:
function quickSort(&$numbers, $array_size,$level)
{
q_sort($numbers, 0, $array_size - 1,$level);
}
function q_sort(&$numbers, $left, $right,$level)
{
$l_hold = $left;
$r_hold = $right;
$pivot = $numbers[$left];
while ($left < $right)
{
if ($level == 'RegID')
{
while (($numbers[$right]->RegID >= $pivot->RegID) && ($left < $right))
$right--;
}
if ($left != $right)
{
$numbers[$left] = $numbers[$right];
$left++;
}
if($level == 'RegID')
{
while (($numbers[$left]->RegID >= $pivot->RegID) && ($left < $right))
$left++;
}
if ($left != $right)
{
$numbers[$right] = $numbers[$left];
$right--;
}
}
$numbers[$left] = $pivot;
$pivot = $left;
$left = $l_hold;
$right = $r_hold;
if ($left < $pivot)
q_sort($numbers, $left, $pivot-1,$level);
if ($right > $pivot)
q_sort($numbers, $pivot+1, $right,$level);
}