public static function removeQueryString($path)
    {
        if (false === $pos = strpos($path, '?')) {
            return $path;
        }

        $anchorPos = strpos($path, '#', $pos);

        $end = false === $anchorPos ? strlen($path) : $anchorPos;

        return substr($path, 0, $pos).substr($path, $end);
    }
public static function removeQueryString($path)
    {
        if (false === $pos = strpos($path, '?')) {
            return $path;
        }

        $anchorPos = strpos($path, '#', $pos);

        $end = false === $anchorPos ? strlen($path) : $anchorPos;

        return substr($path, 0, $pos).substr($path, $end);
    }
public static function removeQueryString ( $ path ) { if ( false === $ pos = strpos ( $ path , '?' ) ) { return $ path ; } $ anchorPos = strpos ( $ path , '#' , $ pos ) ; $ end = false === $ anchorPos ? strlen ( $ path ) : $ anchorPos ; return substr ( $ path , 0 , $ pos ) . substr ( $ path , $ end ) ; }
Removes from "?" position in string. If not found,
returns the original string.

@param string $path

@return string
Removes from ? position in string . If not found returns the original string .