Sort multidimensional array based on multiple values

listed in answer

Sort multidimensional array based on multiple values
0 votes, 0.00 avg. rating (0% score)

ANSWER:

You just have to update your function sortByOrder().

Basically:

function sortByOrder($a, $b)
  if ($b['score'] == $a['score'])
    return $a['fouls'] - $b['fouls'];
  else
    return $b['score'] - $a['score'];

by Frosty Z from http://stackoverflow.com/questions/10615137