Home > Backend Development > PHP Tutorial > 为什么我打印不出来$_SERVER['PATH_INFO']呢

为什么我打印不出来$_SERVER['PATH_INFO']呢

WBOY
Release: 2016-06-23 13:34:17
Original
1785 people have browsed it

即然是全局数组,按说应该能啊,但是var_dump后是一个NULL,啥回事呢,


回复讨论(解决方案)

url 不是 PATH_INFO 形式的时候
$_SERVER['PATH_INFO'] 不存在

$_SERVER 是超全局数组,并不表示他的每一项都存在
比如 $_GET、$_POST 不都是有条件有值的吗

包含由客户端提供的、跟在真实脚本名称之后并且在查询语句(query string)之前的路径信息,如果存在的话。例如,如果当前脚本是通过 URL http://www.example.com/php/path_info.php/some/stuff?foo=bar 被访问,那么 $_SERVER['PATH_INFO'] 将包含 /some/stuff。 

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