Highscores

getHighscores(); /* * Sort multidimensional array according to $array[][1] */ $sortArray = array(); foreach ($highscores as $key => $value) { $sortArray[$key] = $value[1]; } array_multisort($sortArray, SORT_DESC, SORT_NUMERIC, $highscores); $place = 0; foreach ($highscores as $highscore) { if ($highscore[1] <= 21) { $place++; } if ($place != 0) { echo "Place $place: "; } $score = round($highscore[1], 2); echo" $highscore[0] with $score Points in $highscore[2] games
\n"; } ?>

Back to menu