http://example.com/myscript.php/foo//bar
/foo//bar - additional information about the path that follows the actual file name. While Apache reduces multiple slashes in the PATH_INFO server variable (which is passed to the corresponding superglobal PHP), the original URL (with several slashes) is still available in the $ _SERVER ['PHP_SELF'] variable.
So, instead of accessing the path information through the PATH_INFO variable, you can do something like the following:
$pathInfo = str_replace($_SERVER['SCRIPT_NAME'],'',$_SERVER['PHP_SELF']);
It just removes SCRIPT_NAME from PHP_SELF, leaving the path information (if any). You can use REQUEST_URI instead of PHP_SELF, but this includes a query string, so you will need to check this.
So, given the above request, where SCRIPT_NAME is "/myscript.php" and PHP_SELF is "/myscript.php/foo//bar", the resulting $pathInfo is "/ foo // bar".
source share