Home  >  Article  >  Backend Development  >  php获取现阶段url路径的函数

php获取现阶段url路径的函数

WBOY
WBOYOriginal
2016-06-13 12:48:34748browse

php获取当前url路径的函数

转:

PHP获取当前url路径的函数:QUERY_STRING、REQUEST_URI、SCRIPT..

PHP获取当前url路径的函数及服务器变量:QUERY_STRING、REQUEST_URI、SCRIPT..?
?
?


Php代码??收藏代码
  1. $_SERVER["QUERY_STRING"]获取查询语句,实例中可知,获取的是?后面的值??
  2. $_SERVER["REQUEST_URI"]?获取http://172.16.1.7后面的值,包括/??
  3. $_SERVER["SCRIPT_NAME"]?获取当前脚本的路径,如:jms.php??
  4. $_SERVER["PHP_SELF"]?当前正在执行脚本的文件名??
Statement:
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