I have an array which has these cells:
update_table('0', 'Real Klarin', '1', '2', '3', '4', '5', '6', '12', '8');
update_table('1', 'RAKoun', '1', '2', '3', '4', '5', '6', '11', '9');
update_table('2', 'Panklouviakos', '1', '2', '3', '4', '5', '6', '10', '10');
update_table('3', 'Ouza&Zabon', '1', '2', '3', '4', '5', '6', '9', '11');
update_table('4', 'ui48975', '1', '2', '3', '4', '5', '6', '8', '12');
update_table('5', 'Genia tou 98', '1', '2', '3', '4', '5', '6', '7', '13');
and is constructed in a loop like this:
$arrayOfCalls[] = "update_table('".($inc-1)."', '".$team."', '".$gp."', '".$w."', '".$d."', '".$l."', '".$gf."', '".$ga."', '".$gd."', '".$pts."');";
I would like to sort by the last parameter of update_table(), i.e. $pts. So, I read this question: Sort Multi-dimensional Array by Value, which implies that I should have a multidimensional array, which is not what I have. I tried $arrayOfCalls['.$pts.']
, but that did not have any effect.
What should I do (notice that I am a beginner in PHP)?
Oh and in case of a tie, I would like to sort by $gd
, but we can get the sort run by the first key, I think I will find a way for the second!