PATH_INFO is not always set. It is installed only if information about the end of the path appears after the script.
For example, if you have a file located here: localhost / index.php and you access it through this URL: localhost / index.php / foo / bar
then $ _SERVER ['PATH_INFO'] will be set to "/ foo / bar"
, but if you access the script via url: localhost / index.php, then PATH_INFO will not be set, and you will see a notification like this for trying to access the undefined index of an array
Brian source share