Get a partial string version of this url object starting from a particular segment

@return string
337929
public function getPartialURLFromSegment($segmentIdx) {

        $partialURL = "";

        for ($i = $segmentIdx; $i < sizeof($this->segments); $i++) {
            $partialURL .= (($i > $segmentIdx) ? "/" : "") . $this->segments [$i];
        }

        return $partialURL;
    }
1134093
public function getFullUrl(): string
    {
        $queryString = $this->getQueryString();

        return sprintf(
            '%s%s%s',
            static::getBaseUri(),
            $this->getEndpoint(),
            ($queryString) ? '/?'.$queryString : ''
        );
    }
601464
public static function getUriString() : string
    {
        // Get request url and script url
        $url = '';
        $request_url = (isset($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : '';
        $script_url  = (isset($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : '';

        // Get our url path and trim the / of the left and the right
        if ($request_url != $script_url) {
            $url = trim(preg_replace('/'. str_replace('/', '\/', str_replace('index.php', '', $script_url)) .'/', '', $request_url, 1), '/');
        }

        $url = preg_replace('/\?.*/', '', $url); // Strip query string

        return $url;
    }
373405
public function getSubDirName()
    {
        substr(self::$urlParams['root'], -1) != '/' && self::$urlParams['root'] .= '/';
        substr(self::$urlParams['root'], 0, 1) != '/' && self::$urlParams['root'] = '/' . self::$urlParams['root'];
        return self::$urlParams['root'];
    }
1230644
public function toString()
    {
        $parts = [];
        $data = $this->data();
        $parts[] = $data['name'] . '=' . rawurlencode($data['value']);

        if ($data['domain']) {
            $parts[] = 'Domain=' . $data['domain'];
        }
        if ($data['path']) {
            $parts[] = 'Path=' . $data['path'];
        }
        if (isset($data['max-age'])) {
            $parts[] = 'Max-Age=' . (string) $data['max-age'];
        } elseif (isset($data['expires'])) {
            $parts[] = 'Expires=' . gmdate('D, d M Y H:i:s \G\M\T', $data['expires']);
        }
        if ($data['secure']) {
            $parts[] = 'Secure';
        }
        if ($data['httponly']) {
            $parts[] = 'HttpOnly';
        }
        return join('; ', $parts);
    }
37235
public static function getFullPath() {
        $s = &$_SERVER;
        $ssl = (!empty($s['HTTPS']) && $s['HTTPS'] == 'on') ? true : false;
        $sp = strtolower($s['SERVER_PROTOCOL']);
        $protocol = substr($sp, 0, strpos($sp, '/')) . (($ssl) ? 's' : '');
        $port = $s['SERVER_PORT'];
        $port = ((!$ssl && $port == '80') || ($ssl && $port == '443')) ? '' : ':' . $port;
        $host = isset($s['HTTP_X_FORWARDED_HOST']) ? $s['HTTP_X_FORWARDED_HOST'] : (isset($s['HTTP_HOST']) ? $s['HTTP_HOST'] : null);
        $host = isset($host) ? $host : $s['SERVER_NAME'] . $port;
        $uri = $protocol . '://' . $host . $s['REQUEST_URI'];
        $segments = explode('?', $uri, 2);
        $url = $segments[0];
        return $url;
    }
474005
public function getAbsoluteUrl()
    {
        $https = Kwf_Util_Https::domainSupportsHttps($this->getDomain());
        $protocol = $https ? 'https' : 'http';
        return $protocol . '://'.$this->getDomain().$this->url;
    }
702783
public static function getCurrentUrlNoParam(){
		$url = self::getCurrentUrl();
		if(strstr($url,"#")){
			$url = substr($url,0,strpos($url,"#"));
		}
		
		if(strstr($url,"?")){
			$url = substr($url,0,strpos($url,"?"));
		}
		return $url;
		
	}
179457
public function getFullPathAttribute()
    {
        $pathSections = explode('/', $this->getFullPath());

        $slugsToExclude = array_wrap($this->domainMappedFolders);

        $finalSlug = collect($pathSections)
            ->filter()
            ->reject(function ($slug) use ($slugsToExclude) {
                return in_array($slug, $slugsToExclude);
            })
            ->implode('/');

        return str_start($finalSlug, '/');
    }
353382
public function get_normalized_http_url() {

        $parts = parse_url($this->http_url);

        $scheme = (isset($parts['scheme'])) ? $parts['scheme'] : 'http';
        $port = (isset($parts['port'])) ? $parts['port'] : (($scheme == 'https') ? '443' : '80');
        $host = (isset($parts['host'])) ? strtolower($parts['host']) : '';
        $path = (isset($parts['path'])) ? $parts['path'] : '';

        if (($scheme == 'https' && $port != '443')
            || ($scheme == 'http' && $port != '80')) {
            $host = "$host:$port";
        }

        return "$scheme://$host$path";

    }
876506
public function toString()
    {
        $string = '';

        if ($this->scheme) {
            $slashes = $this->isFlat() ? '' : '//';
            $string .= "{$this->scheme}:$slashes";
        }

        if ($authority = $this->getAuthority()) {
            $string .= $authority;
        }

        if ($this->path->count() && !$this->isFlat()) {
            $prefix = $authority || $this->path->getPrefix() ? '/' : '';
            $string .= $prefix.ltrim((string) $this->path, '/');
        }

        if ($this->query) {
            $string .= '?'.http_build_query($this->query);
        }

        if ($this->fragment) {
            $string .= "#{$this->fragment}";
        }

        return $string;
    }
1292479
public static function fullUrl()
    {
        $s        = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : "";
        $protocol = StringUtils::strLeft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/").$s;
        $port     = ($_SERVER["SERVER_PORT"] == "80" || $_SERVER["SERVER_PORT"] == "443") ? "" : (":".$_SERVER["SERVER_PORT"]);
        $uri      = (isset($_SERVER['REQUEST_URI'])?$_SERVER['REQUEST_URI']:"");
        return $protocol."://".$_SERVER['SERVER_NAME'].$port.$uri;
    }
1160458
public function fullUrl()
    {
        $query = $this->getQueryString();

        return $query ? $this->url().'?'.$query : $this->url();
    }
172874
public static function parsedURLToString($parsed_url) {

		$components = [];

		if(!empty($parsed_url['scheme'])){

			$components['scheme'] = $parsed_url['scheme'] . '://';
		}

		$components['user'] = '';
		$components['pass'] = '';

		if(!empty($parsed_url['user'])){

			$components['user'] = $parsed_url['user'];
		}

		if(!empty($parsed_url['pass'])){

			$components['pass'] = ':' . $parsed_url['pass'];
		}

		if($components['user'] || $components['pass']){

			$components['pass'] = $components['pass'] . '@';
		}

		if(!empty($parsed_url['host'])){

			$components['host'] = $parsed_url['host'];
		}

		if(!empty($parsed_url['port'])){

			$components['port'] = ':' . $parsed_url['port'];
		}

		if(!empty($parsed_url['path'])){

			$components['path'] = $parsed_url['path'];
		}

		if(!empty($parsed_url['query'])){

			$components['query'] = '?' . $parsed_url['query'];
		}

		if(!empty($parsed_url['fragment'])){

			$components['fragment'] = '#' . $parsed_url['fragment'];
		}

		return implode('', $components);
	}
224026
public function getHostRelativeUrl()
    {
        $url = $this->getPath();
        if ($this->hasQueryString()) $url .= '?' . $this->getQueryString();
        if ($this->hasFragmentString()) $url .= '#' . $this->getFragmentString();
        return $url;
    }
1033549
public function getFullUrl()
    {
        if ($this->_fullUrl === null) {
            $this->_fullUrl = $this->createFullUrl($this->getUrl());
        }
        return $this->_fullUrl;
    }
881935
public function toString()
    {
        $result = "";
        if ($this->scheme) {
            $result .= $this->scheme.'://';
        }
        if ($this->user) {
            $result .= $this->user;
            if ($this->pass) {
                $result .= $this->user;
            }
            $result .= '@';
        }
        if ($this->host) {
            $result .= $this->host;
        }
        if ($this->port) {
            $result .= ':'.$this->port;
        }
        if ($this->pathSegments) {
            $result .= '/'.implode('/', $this->pathSegments);
        }
        if ($this->parameters) {
            $result .= '?'.http_build_query($this->parameters);
        }
        if ($this->fragment) {
            $result .= '#'.$this->fragment;
        }
        return $result;
    }