diff --git a/matchinfo.php b/matchinfo.php new file mode 100644 index 0000000..0a6ee08 --- /dev/null +++ b/matchinfo.php @@ -0,0 +1,38 @@ +"; + echo "Player NameKillsDamage DealtTime SurvivedRank"; + + // 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 ""; + } + } + } + echo ""; + } else { + echo "JSON file not found for the given match ID."; + } +} else { + echo "No match ID provided."; +} +?>