首页 > 编程语言 >PHP 获取当前完整URL路径

PHP 获取当前完整URL路径

时间:2023-03-29 14:01:09浏览次数:35  
标签:http https URL 路径 SERVER && HTTP PHP HTTPS

不包含 #

$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

相关文章