I'm tryring to sort a [300][2] array based on the data held in positon 2 of the array.

This is the routine I have come up with but it's a no go. Any help would be great.

PHP Code:
for (i=1;i>=MAXARRAY-1;i++) {
          for(
i2=0;i2<MAXARRAY;i2++) {
               if(
iTF[i2][1] > iTF[i2 1][1]) {
                    
iTemp iTF[i2][0];
                    
iTemp1 iTF[i2][1];
                    
iTF[i2][0] = iTF[i2 1][0];
                    
iTF[i2][1] = iTF[i2 1][1];
                    
iTF[i2 1][0] = iTemp;
                    
iTF[i2 1][1] = iTemp1;
               }
          }