"; print_r($jsonData); echo ""; // Start building the HTML table echo ""; echo ""; // 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 ""; echo ""; echo ""; echo ""; echo ""; echo ""; } } } echo "
Player NameKillsDamage DealtTime SurvivedRank
" . htmlspecialchars($playerStats['name']) . "" . htmlspecialchars($playerStats['kills']) . "" . htmlspecialchars($playerStats['damageDealt']) . "" . htmlspecialchars($playerStats['timeSurvived']) . "" . htmlspecialchars($playerStats['winPlace']) . "
"; } else { echo "JSON file not found for the given match ID."; } } else { echo "No match ID provided."; } ?>