tp|tp 判断是http还是https

【tp|tp 判断是http还是https】获取网站URL

$http = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] && $_SERVER['HTTPS'] != 'off') ? 'https' : 'http'; define('SITE_URL',$http.'://'.$_SERVER['HTTP_HOST']); // 网站域名

    推荐阅读