From 165f30188ad421dbaa4678eb42261d0721387ed1 Mon Sep 17 00:00:00 2001 From: Lanta Date: Wed, 22 Nov 2023 16:00:35 +0100 Subject: [PATCH] foreach --- latestmatches.php | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/latestmatches.php b/latestmatches.php index c9542ef..4baa8ea 100644 --- a/latestmatches.php +++ b/latestmatches.php @@ -61,27 +61,27 @@ $ogDescription = "Dive into the detailed match stats of DTCH Clan in PUBG. Explo echo ""; echo ""; foreach ($players_matches as $match) { - foreach($match['stats'] as $stats) - if ($stats['name'] === $selected_player) { + foreach ($match['stats'] as $stats) { + if ($stats['name'] === $selected_player) { - if (isset($_GET['filter_by_match_type'])) { - if ($_GET['filter_by_match_type'] !== 'all' && $match['matchType'] !== $_GET['filter_by_match_type']) { - continue; + if (isset($_GET['filter_by_match_type'])) { + if ($_GET['filter_by_match_type'] !== 'all' && $match['matchType'] !== $_GET['filter_by_match_type']) { + continue; + } } - } - $date = new DateTime($match['createdAt']); - $date->modify('+1 hours'); - $formattedDate = $date->format('m-d H:i:s'); + $date = new DateTime($match['createdAt']); + $date->modify('+1 hours'); + $formattedDate = $date->format('m-d H:i:s'); - $matchType = $match['matchType']; - $gameMode = $match['gameMode']; - $mapName = isset($mapNames[$match['mapName']]) ? $mapNames[$match['mapName']] : $match['mapName']; - $kills = $stats['kills']; - $damage = number_format($stats['damageDealt'], 0, '.', ''); - $timeSurvived = $stats['timeSurvived']; - $winPlace = $stats['winPlace']; - echo " + $matchType = $match['matchType']; + $gameMode = $match['gameMode']; + $mapName = isset($mapNames[$match['mapName']]) ? $mapNames[$match['mapName']] : $match['mapName']; + $kills = $stats['kills']; + $damage = number_format($stats['damageDealt'], 0, '.', ''); + $timeSurvived = $stats['timeSurvived']; + $winPlace = $stats['winPlace']; + echo " @@ -95,8 +95,8 @@ $ogDescription = "Dive into the detailed match stats of DTCH Clan in PUBG. Explo + } } - } echo "
Match DateGame ModeMatch TypeMapKillsDamage DealtTime Survivedwin Place
" . $formattedDate . " " . $gameMode . " " . $matchType . "

"; ?>