开发者

How do you consistently retrieve the path information from the query in php? (/index.php/foo/bar)

开发者 https://www.devze.com 2022-12-08 20:21 出处:网络
Basically if the user requests: index.php/foo/bar I need开发者_如何学Go \"/foo/bar\" and for index.php

Basically if the user requests:

index.php/foo/bar

I need开发者_如何学Go "/foo/bar" and for

index.php

I need "" or "/"

I couldn't find any information on google because I don't know what this is called (path info got me the pathinfo() function)

I found PHP_SELF returns differently if there is path info than if there is no info


The portion after your file name /index.php is called the path info (see Apache’s AcceptPathInfo directive). You can access that information with the $_SERVER['PATH_INFO'] variable. And if you want the full requested URL path with query, use $_SERVER['REQUEST_URI'].

0

精彩评论

暂无评论...
验证码 换一张
取 消