X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Farray.php;h=ead0d55f38e3d07abf485a772f0bae9b3218dbce;hb=bbdd6ddbafa7068c7c8467392f1988e99ad2f5f0;hp=5d959fe1441d4a219b5d1daddb572b0714d4a85f;hpb=b9bfd165b055eac4f5e62438ae78eaab01cbb90e;p=squirrelmail.git diff --git a/functions/array.php b/functions/array.php index 5d959fe1..ead0d55f 100644 --- a/functions/array.php +++ b/functions/array.php @@ -1,14 +1,16 @@ 0) + $dir = 1; + else + $dir = -1; $GLOBALS['dir'] = $dir; // Direction, a positive number for ascending a negative for descending - usort($ary,'comp2'); + usort($ary,'array_comp2'); return $ary; } - function comp2($a,$b,$i = 0) { + function array_comp2($a,$b,$i = 0) { global $col; global $dir; $c = count($col) -1; @@ -35,11 +41,9 @@ $r = comp2($a,$b,$i); } } elseif($a[$col[$i]] < $b[$col[$i]]){ - $r = -1 * $dir; // Im not sure why you must * dir here, but it wont work just before the return... - } else { - $r = 1 * $dir; - } - return $r; + return (- $dir); + } + return $dir; } function removeElement($array, $element) {