PHP检测链接是否是SSL连接 ,也就是判断HTTPS
function
is_SSL(){
if
(!isset(
$_SERVER
[
'HTTPS'
]))
return
FALSE;
if
(
$_SERVER
[
'HTTPS'
] === 1){
//Apache
return
TRUE;
}
else
if
(
$_SERVER
[
'HTTPS'
] ===
'on'
) {
//IIS
return
TRUE;
}
elseif
(
$_SERVER
[
'SERVER_PORT'
] == 443) {
//其他
return
TRUE;
}
return
FALSE;
}