温馨提示×

php怎么获取当前的https

九三
321
2021-03-03 10:25:20
栏目: 编程语言

php怎么获取当前的https

使用php获取当前https,具体方法如下:

function get_http_type()

{

$http_type = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')) ? 'https://' ;

return $http_type;

}

0