index.php?pathname/subpath/sub-subpath
// index.php <?php print '<pre>'; print_r($_REQUEST); // Will also contain whatever session variables that are set... print_r($_GET); print '</Pre>';
// output of index.php Array // Output of $_REQUEST ( [pathname/subpath/sub-subpath] => [SESSvariables_maybe_set] => ) Array // Output of $_GET ( [pathname/subpath/sub-subpath] => )
/index.php/pathname/subpath/sub-subpath
echo $_SERVER['REQUEST_URI'] ; // /index.php/pathname/subpath/sub-subpath
$uri = $_SERVER['REQUEST_URI'];$file = '/' . strtolower( basename( __FILE__ ) );$base = strtolower( substr( $uri, 0, strlen( $file ) ) );if ( $uri !== $file && $file === $base ){ $uri = substr( $uri, strlen( $file ) );}// http://localhost/echo $uri; // -> /// http://localhost/index.phpecho $uri; // -> /index.php// http://localhost/index.php/echo $uri; // -> /// http://localhost/index.php/some/path/nameecho $uri; // -> /some/path/name