protected function cleanUrl($url)
    {
        $parts = parse_url($url);
        $fragment = empty($parts['fragment']) ? '' : '#'.$parts['fragment'];
        $path = empty($parts['path']) ? '/' : $parts['path'];

        return preg_replace('/^\/[^\.\/]+\.php\//', '/', $path).$fragment;
    }
protected function cleanUrl($url)
    {
        $parts = parse_url($url);
        $fragment = empty($parts['fragment']) ? '' : '#'.$parts['fragment'];
        $path = empty($parts['path']) ? '/' : $parts['path'];

        return preg_replace('/^\/[^\.\/]+\.php\//', '/', $path).$fragment;
    }
protected function cleanUrl ( $ url ) { $ parts = parse_url ( $ url ) ; $ fragment = empty ( $ parts [ 'fragment' ] ) ? '' : '#' . $ parts [ 'fragment' ] ; $ path = empty ( $ parts [ 'path' ] ) ? '/' : $ parts [ 'path' ] ; return preg_replace ( '/^\/[^\.\/]+\.php\//' , '/' , $ path ) . $ fragment ; }
Trims scriptname from the URL.

@param string $url

@return string
Trims scriptname from the URL .