PHP怎么简单快速获取当前URL地址(包括后面参数)

WBOY
Release: 2016-06-13 11:54:36
Original
1570 people have browsed it

PHP如何简单快速获取当前URL地址(包括后面参数)
如果,如何最简单的获取当前URL的地址,不包括域名,但包括后面的参数。

如:http://127.0.0.1/index.php?r=admin/index/index&type=aa

这样的一个地址,我想获取/index.php?r=admin/index/index&type=aa这一部分。

PHP怎么写?
------解决方案--------------------

$uri = "http://127.0.0.1/index.php?r=admin/index/index&type=aa";<br />var_dump ( parse_url ( $uri ));
Copy after login

------解决方案--------------------
$_SERVER['REQUEST_URI']

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template