public static function addQueryString($path, $queryString = null)
    {
        if(null === $queryString) {
            return $path;
        }

        return sprintf("%s%s%s",
            $path,
            preg_match("#\?#", $path) ? (
                preg_match("#\?$#", $path) ?
                '' : '&'
            ) : '?',
            is_array($queryString) ? http_build_query($queryString) : $queryString
        );
    }
public static function addQueryString($path, $queryString = null)
    {
        if(null === $queryString) {
            return $path;
        }

        return sprintf("%s%s%s",
            $path,
            preg_match("#\?#", $path) ? (
                preg_match("#\?$#", $path) ?
                '' : '&'
            ) : '?',
            is_array($queryString) ? http_build_query($queryString) : $queryString
        );
    }
public static function addQueryString ( $ path , $ queryString = null ) { if ( null === $ queryString ) { return $ path ; } return sprintf ( "%s%s%s" , $ path , preg_match ( "#\?#" , $ path ) ? ( preg_match ( "#\?$#" , $ path ) ? '' : '&' ) : '?' , is_array ( $ queryString ) ? http_build_query ( $ queryString ) : $ queryString ) ; }
Add query string

@param string       $path
@param string|array $queryString

@return string
Add query string