Suddenly can’t find what you want to use?
$_SERVER['HTTP_HOST']//获取域名或主机地址
$_SERVER['PHP_SELF']//获取网页地址
$_SERVER["QUERY_STRING"]//获取网址参数
.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];//获取完整的url
$url='http://'.$_SERVER['SERVER_NAME'].$_SERVER["REQUEST_URI"]; echo dirname($url);//只取路径
Copyright Statement: This article is an original article by the blogger and may not be reproduced without the blogger's permission.
The above introduces how to get the current page address in PHP, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.