首页 小组 文章 搜索 我的社区 用户

判断操作系统位数

2019-01-10 16:52:38
0
470



function getDomain($protocol = true){
$domain = '';
if ($protocol){
$domain .= ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')) ? 'https://' : 'http://';
}

if($_SERVER['HTTP_HOST']){
$domain .= $_SERVER['HTTP_HOST'];
}else{
$domain .= $_SERVER['SERVER_NAME'];
if ($_SERVER['SERVER_PORT'] != 80){
$domain .= ':'.$_SERVER['SERVER_PORT'];
}
}

return $domain;
}


用户评论