User Stats
"; // Displaying top 10 comparisons for each attribute $attributes = ['dBNOs', 'damageDealt', 'roadKills', 'teamKills']; 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 "| Player | $attribute |
|---|---|
| $player_name | {$player_details[$account_id][$attribute]} |
"; } echo "Last update " ; echo $players_data['updated']; ?>