Forum Moderators: coopster
while () {
$rank[] = array(1 => "field1", 2 => "field2",
3 => "field3", 4 => "field4", 5 => "field5");
}
Field 5 is the calculated value (the weight) and now I want to sort the array ($rank) on this. I was looking at array_multisort to do this but I'm stuck on syntax - or is this the wrong function to use?
I think that is right. I always have problems because if you don't put the other elements in thee it doesn't keep the rows together.
try that and see if it works, if not I will go find anothwer script I have that multisorts and check it out.
So using multisort only sorts the array based on all fields rather than what I need which is to sort on one field.