I would like to realize a method for sorting football groups
- by points (sorted as numbers, in descending order),
- then by goals scored (sorted as numbers, in descending order),
- then by name (sorted as strings in ascending order).
For example, if I have this multidimensional array:
$group = array(
array("Juve", 15, 45), // the values are name, points and goals scored
array("Inter", 21, 40),
array("Milan", 15, 50)
);
I would like to have this result:
$group = array(
array("Inter", 21, 40),
array("Milan", 15, 50),
array("Juve", 15, 45)
);