What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']?

前端 未结 4 977
闹比i
闹比i 2020-12-16 21:32

What’s the difference between $_SERVER[\'PATH_INFO\'] and $_SERVER[\'ORIG_PATH_INFO\']? How do I use them?

When I run print_r($_SERVE

4条回答
  •  感情败类
    2020-12-16 22:20

    PATH_INFO and ORIG_PATH_INFO are rarely used. These refer to anything in the request path (the part of the URL from the first / on) that comes after the name of the file, and the query string. Generally, you won't have a PATH_INFO in a URL.

    I am guessing you mean ORIG_PATH_INFO and not PORIG_PATH_INFO. The path info may be manipulated by things like mod_rewrite and PHP scripts themselves. ORIG_PATH_INFO is the PATH_INFO as it was in the original request, before any rewriting or other manipulation was done to the string.

提交回复
热议问题