foreach ($_POST as $k => $value) { if (!isset($trackingContainer[$k])) { $splitKey = explode("-", $k); $worldID = $splitKey[0]; $channelNumber = $splitKey[1]; $mapID = $splitKey[2]; $trackingDAO->insertTracking($worldID, $channelNumber, $mapID); } } foreach ($trackingContainer as $k => $value) { if (!isset($_POST[$k])) { $splitKey = explode("-", $k); $worldID = $splitKey[0]; $channelNumber = $splitKey[1]; $mapID = $splitKey[2]; $trackingDAO->removeTracking($worldID, $channelNumber, $mapID); } } } $worldContainer = $worldDAO->getAllWorlds(); $mapContainer = $mapDAO->getAllMaps(); $trackingContainer = $trackingDAO->getAllTrackings(); ?> <!DOCTYPE html> <html> <head> <?php include 'partials/header.partial.php'; ?> </head>