Jamers Posted November 20, 2015 Report Share Posted November 20, 2015 包括协议,端口以及路径。 function getcururl() { $http_type = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')) ? 'https://' : 'http://'; $self = $_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME']; return $http_type.$self; } Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now