PHP program to Check whether the page is called from 'https' or 'http'

bookmark

<?php
if (!empty($_SERVER['HTTPS'])) 
{
  echo 'https is enabled';
}
else
{
echo 'http is enabled'."\n";
}
?>

Output:

http is enabled