CI_URI::_remove_relative_directory PHP Method

_remove_relative_directory() protected method

./) and multi slashes (///) Do some final cleaning of the URI and return it, currently only used in self::_parse_request_uri()
protected _remove_relative_directory ( string $uri ) : string
$uri string
return string
    protected function _remove_relative_directory($uri)
    {
        $uris = array();
        $tok = strtok($uri, '/');
        while ($tok !== FALSE) {
            if ((!empty($tok) or $tok === '0') && $tok !== '..') {
                $uris[] = $tok;
            }
            $tok = strtok('/');
        }
        return implode('/', $uris);
    }