不包含 #
$http_type = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')) ? 'https://' : 'http://';
echo $http_type . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
标签:http,https,URL,路径,SERVER,&&,HTTP,PHP,HTTPS
From: https://blog.51cto.com/u_14682436/6156900