diff --git a/matchinfo.php b/matchinfo.php
index b49d7de..587bcbc 100644
--- a/matchinfo.php
+++ b/matchinfo.php
@@ -17,20 +17,20 @@ if (isset($_GET['matchid'])) {
echo "
| Player Name | Kills | Damage Dealt | Time Survived | Rank |
";
// Loop through the JSON data to extract player stats
- foreach ($jsonData['data']['relationships']['rosters']['data'] as $roster) {
- foreach ($jsonData['included'] as $includedItem) {
- if ($includedItem['type'] === 'participant' && in_array(['type' => 'participant', 'id' => $includedItem['id']], $roster['relationships']['participants']['data'])) {
- $playerStats = $includedItem['attributes']['stats'];
- echo "";
- echo "| " . htmlspecialchars($playerStats['name']) . " | ";
- echo "" . htmlspecialchars($playerStats['kills']) . " | ";
- echo "" . htmlspecialchars($playerStats['damageDealt']) . " | ";
- echo "" . htmlspecialchars($playerStats['timeSurvived']) . " | ";
- echo "" . htmlspecialchars($playerStats['winPlace']) . " | ";
- echo "
";
- }
- }
+
+ foreach ($jsonData['included'] as $includedItem) {
+
+ $playerStats = $includedItem['attributes']['stats'];
+ echo "";
+ echo "| " . htmlspecialchars($playerStats['name']) . " | ";
+ echo "" . htmlspecialchars($playerStats['kills']) . " | ";
+ echo "" . htmlspecialchars($playerStats['damageDealt']) . " | ";
+ echo "" . htmlspecialchars($playerStats['timeSurvived']) . " | ";
+ echo "" . htmlspecialchars($playerStats['winPlace']) . " | ";
+ echo "
";
+
}
+
echo "";
} else {
echo "JSON file not found for the given match ID.";
@@ -38,4 +38,4 @@ if (isset($_GET['matchid'])) {
} else {
echo "No match ID provided.";
}
-?>
+?>
\ No newline at end of file