PHP Web Based HTTPS Check - PHP Code

Learn how to check if a web server is using HTTPS or HTTP using PHP code. Enhance website security and user privacy with this simple tutorial.

<?php
if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) {
} else {
}