<?php
// Define the URL to monitor
$monitorUrl = "https://example.com";
// Function to check URL status
function checkUrlStatus($url) {
$headers = get_headers($url);
$status = substr($headers[0], 9, 3);
return $status == "200" ? "OK" : "Failed";
}
// Check the URL status
$status = checkUrlStatus($monitorUrl);
// Output the status
echo "Status of {$monitorUrl}: {$status}";
?>