$file = basename($_SERVER['REQUEST_URI']); $requestPath = ".." . $_SERVER['REQUEST_URI']; $requestPath = str_replace($file, "", $requestPath);