5 ** This contains functions that work with array manipulation. They
6 ** will help sort, and do other types of things with arrays
10 function ary_sort($ary,$col, $dir = 1){
11 // The globals are used because USORT determines what is passed to comp2
12 // These should be $this->col and $this->dir in a class
13 // Would beat using globals
17 $GLOBALS["col"] = $col; // Column or Columns as an array
18 $GLOBALS["dir"] = $dir; // Direction, a positive number for ascending a negative for descending
20 function comp2($a,$b,$i = 0) {
24 if ($a["$col[$i]"] == $b["$col[$i]"]){
26 while($i < $c && $r == 0){
30 } elseif($a["$col[$i]"] < $b["$col[$i]"]){
31 $r = -1 * $dir; // Im not sure why you must * dir here, but it wont work just before the return...