Say you have an array that consists of rows of data from a database and a one column a custom created number. Ex: you have 4 rows and 3 columns as an array where the 3rd column is a special number you created when making the array:
while($newrow = $dbgetrow($query)) {
....$specialnumber = $somevar/$newrow[3];
....$thearray[] = array($newrow[0],$newrow[1],$specialnumber);
}
That would make something like:
.........0.......1.........2
0...title1...date....2.45
1...title2...date....1.223
2...title3...date....7
3...title4...date....23.44
Now, say you want to sort "thearray" by the third column (the specialnumber inserted for each row). So you end up with this:
.........0.......1.........2
0...title2...date....1.223
1...title1...date....2.45
2...title4...date....23.44
3...title3...date....7
So then you can easily output that to HTML in ORDER by the special number made.
How would you do this? All the sort functions I see are sad... only dealing with ONE ROW and sorting all the elements in it. Which is bad, considering if each element in the row is in no way tied to any other element.
Surely there has to be a way to do this ... how else would you get anything done thats the slight bit complex?