public function setHost(string $hostname)
    {
        if (($ppos = strrpos($hostname, ":")) !== false)
        {
            $this->port = substr($hostname, $ppos + 1);
            $hostname = substr($hostname, 0, $ppos);
        }

        if (substr($hostname, 0, 4) === "xn--")
            $hostname = \idn_to_utf8($hostname);

        $this->host = strtolower($hostname);
        return $this;
    }
public function setHost(string $hostname)
    {
        if (($ppos = strrpos($hostname, ":")) !== false)
        {
            $this->port = substr($hostname, $ppos + 1);
            $hostname = substr($hostname, 0, $ppos);
        }

        if (substr($hostname, 0, 4) === "xn--")
            $hostname = \idn_to_utf8($hostname);

        $this->host = strtolower($hostname);
        return $this;
    }
public function setHost ( string $ hostname ) { if ( ( $ ppos = strrpos ( $ hostname , ":" ) ) !== false ) { $ this -> port = substr ( $ hostname , $ ppos + 1 ) ; $ hostname = substr ( $ hostname , 0 , $ ppos ) ; } if ( substr ( $ hostname , 0 , 4 ) === "xn--" ) $ hostname = \ idn_to_utf8 ( $ hostname ) ; $ this -> host = strtolower ( $ hostname ) ; return $ this ; }
Set the host name of the URL
@param string $hostname The hostname to set
Set the host name of the URL