Home >Backend Development >PHP Tutorial > PHP获取现阶段url路径的函数:QUERY_STRING、REQUEST_URI、SCRIPT.

PHP获取现阶段url路径的函数:QUERY_STRING、REQUEST_URI、SCRIPT.

WBOY
WBOYOriginal
2016-06-13 13:19:43905browse

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


$_SERVER["QUERY_STRING"]获取查询语句,实例中可知,获取的是?后面的值
$_SERVER["REQUEST_URI"] 获取http://172.16.1.7后面的值,包括/
$_SERVER["SCRIPT_NAME"] 获取当前脚本的路径,如:jms.php
$_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