PHP 判断协议是否为HTTPS 1 if ($_SERVER['HTTPS'] != "on") { 2 echo "This is not HTTPS"; 3 }else{ 4 echo "This is HTTPS"; 5 }