User Stats


"; // Displaying top 10 comparisons for each attribute $attributes = ['wins','top10s','kills','dBNOs','damageDealt','headshotKills','roadKills','teamKills','roundMostKills']; foreach ($attributes as $attribute) { echo "

Top 10 $attribute

"; uasort($players_data[$selected_mode], function ($a, $b) use ($attribute) { $account_id_a = array_key_first($a); $account_id_b = array_key_first($b); return $b[$account_id_b][$attribute] <=> $a[$account_id_a][$attribute]; // Sort in descending order }); echo ""; echo ""; $count = 0; foreach ($players_data[$selected_mode] as $player_name => $player_details) { if ($count++ >= 10) break; // Limit to top 10 players $account_id = array_key_first($player_details); echo ""; } echo "
Player$attribute
$player_name{$player_details[$account_id][$attribute]}

"; } echo "Last update " ; echo $players_data['updated']; ?>