Average User Stats
+ + + + +"; + + $metrics = [ + 'Kills' => 'kills', + 'Damage' => 'damageDealt', + 'Headshots' => 'headshotKills', + 'Wins' => 'wins', + 'Top10s' => 'top10s' + ]; + + echo "
| Player | "; + foreach ($metrics as $display => $metric) { + echo "Average $display | "; + } + echo "
|---|---|
| $player_name | "; + foreach ($metrics as $metric) { + $averageValue = ($totalGames > 0) ? round($stats[$metric] / $totalGames, 2) : 0; + echo "$averageValue | "; + } + echo "
"; + echo "Last update " ; + echo $players_data['updated']; + ?> +