如何使用php判断服务器是否是HTTPS连接

2015-01-24信息快讯网

需要判断代码运行环境是否是HTTPS服务器?下面的代码可以帮助你实现,非常简单

if ($_SERVER['HTTPS'] != "on") {
 echo "This is not HTTPS";
}else{
 echo "This is HTTPS";
}if ($_SERVER['HTTPS'] != "on") {
 echo "This is not HTTPS";
}else{
 echo "This is HTTPS";
}

©2014-2024 dbsqp.com