diff($currentDate)->days; // Calculate days difference // Check if the expiration date is today or has passed if ($expirationDateTime <= $currentDate) { $licenseValid = true; // Set license as valid since it is expired } // Check if the expiration date is within the next 10 days and not expired if ($dateDifference > 0 && $dateDifference <= 10) { $expirationWarning = true; } fclose($handle); } } } } } $_SESSION['difference'] = $dateDifference; ?>