Contao\Environment::httpHost PHP Method

httpHost() protected static method

Return the HTTP Host
protected static httpHost ( ) : string
return string The host name
    protected static function httpHost()
    {
        if (!empty($_SERVER['HTTP_HOST'])) {
            $host = $_SERVER['HTTP_HOST'];
        } else {
            $host = $_SERVER['SERVER_NAME'];
            if ($_SERVER['SERVER_PORT'] != 80) {
                $host .= ':' . $_SERVER['SERVER_PORT'];
            }
        }
        return preg_replace('/[^A-Za-z0-9[\\].:-]/', '', $host);
    }