獲取當前協議
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://' : 'http://';
return $http_type;
}
獲取當前域名
$_SERVER['HTTP_HOST']
本作品採用《CC 協議》,轉載必須註明作者和本文連結