Return the header class to use for a header name.

@param string $header  The header name.

@return string  The Horde_Mime_Headers_* class to use.
420733
protected function _getHeaderClassName($header)
    {
        if (empty(self::$_handlers)) {
            $search = array(
                'Horde_Mime_Headers_Element_Single',
                'Horde_Mime_Headers_AddressesMulti',
                'Horde_Mime_Headers_Addresses',
                'Horde_Mime_Headers_ContentDescription',
                'Horde_Mime_Headers_ContentId',
                'Horde_Mime_Headers_ContentLanguage',
                'Horde_Mime_Headers_ContentParam_ContentDisposition',
                'Horde_Mime_Headers_ContentParam_ContentType',
                'Horde_Mime_Headers_ContentTransferEncoding',
                'Horde_Mime_Headers_Date',
                'Horde_Mime_Headers_Identification',
                'Horde_Mime_Headers_MessageId',
                'Horde_Mime_Headers_Mime',
                'Horde_Mime_Headers_MimeVersion',
                'Horde_Mime_Headers_Received',
                'Horde_Mime_Headers_Subject',
                'Horde_Mime_Headers_UserAgent'
            );

            foreach ($search as $val) {
                foreach ($val::getHandles() as $hdr) {
                    self::$_handlers[$hdr] = $val;
                }
            }
        }

        $header = Horde_String::lower($header);

        return isset(self::$_handlers[$header])
            ? self::$_handlers[$header]
            : 'Horde_Mime_Headers_Element_Multiple';
    }
723087
protected function _extractHttpCode($header) {
		preg_match(
			'#^HTTP/[0-9\.]+\s(?P<code>[0-9]+)#i',
			$header,
			$matches
		);

		return isset($matches['code'])
			? $matches['code']
			: $this->_defaultCode;
	}
1090291
public function getHeader($header) {
		foreach($this->headers as $k => $v) {
			if($v[0] === $header)
				return $v;
		}
	}
541945
public function getHeaderValue($header, $glue = '')
    {
        if ($header = $this->response->getHeader($header, true)) {
            if (is_array($header)) {
                return implode($glue, $header);
            }
        }

        return $header;
    }
421363
public function getHeader($name)
    {
        $name = mb_strtolower($name);
        return isset($this->headers[$name]) ? $this->headers[$name] : null;
    }
1071115
private function extractPriority($header) {
        if(preg_match('/x\-priority\:.*([0-9]{1,2})/i', $header, $priority)){
            $priority = isset($priority[1]) ? (int) $priority[1] : 0;
            switch($priority){
                case IMAP::MESSAGE_PRIORITY_HIGHEST;
                    $priority = IMAP::MESSAGE_PRIORITY_HIGHEST;
                    break;
                case IMAP::MESSAGE_PRIORITY_HIGH;
                    $priority = IMAP::MESSAGE_PRIORITY_HIGH;
                    break;
                case IMAP::MESSAGE_PRIORITY_NORMAL;
                    $priority = IMAP::MESSAGE_PRIORITY_NORMAL;
                    break;
                case IMAP::MESSAGE_PRIORITY_LOW;
                    $priority = IMAP::MESSAGE_PRIORITY_LOW;
                    break;
                case IMAP::MESSAGE_PRIORITY_LOWEST;
                    $priority = IMAP::MESSAGE_PRIORITY_LOWEST;
                    break;
                default:
                    $priority = IMAP::MESSAGE_PRIORITY_UNKNOWN;
                    break;
            }
        }

        return $priority;
    }
1174875
private function getHeader($name)
    {
        if (isset($this->headers[$name])) {
            return $this->headers[$name];
        }
        return false;
    }
1335544
public function getHeader($header)
    {
        $response = $this->getResponse();

        return $response->hasHeader($header) ? $response->getHeader($header)[0] : null;
    }
1249470
public function getRequestHeader($header)
    {
        $header = str_replace('-', '_', strtoupper($header));
        $value = $this->{'HTTP_' . $header};

        if (!$value) {
            $headers = $this->getRequestHeaders();
            $value = !empty($headers[$header]) ? $headers[$header] : null;
        }

        return $value;
    }
1345124
public function getHeader($name)
    {
        $k = 'HTTP_' . strtoupper(strtr($name, Generic::$htr));
        return isset($this->headers[$k]) ? $this->headers[$k] : null;
    }
393516
public function deserialize($header)
    {
        if (preg_match(self::CONTEXT_HEADER_FORMAT, $header, $matches)) {
            return new SpanContext(
                strtolower($matches[1]),
                array_key_exists(2, $matches) && !empty($matches[2])
                    ? $this->decToHex($matches[2])
                    : null,
                array_key_exists(3, $matches) ? $matches[3] == '1' : null,
                true
            );
        }
        return new SpanContext();
    }
48906
public function header($header = null) {
			if ($this->_status != null) {
				array_push($this->_headers, $header);
				return true;
			}
			else {
				return $this->_headers;
			}
		}
1278644
public function getHeader($name)
    {
        if (array_key_exists($name, $this->headers)) {
            return $this->headers[$name];
        }
        return null;
    }
1222556
public static function getHeader(string $header):  ? string
    {
        self::init();
        if (function_exists('\getallheaders')) {
            $headers = array_change_key_case(getallheaders(), CASE_UPPER);
            $header  = str_replace('_', '-', $header);
            return $headers[strtoupper($header)] ?? null;
        }

        //通过$_SERVER寻找
        foreach ($_SERVER as $key => $value) {
            if (substr($key, 0, 5) === 'HTTP_') {
                $key    = substr($key, 5); //HTTP开头认为是header头
                $header = str_replace('-', '_', $header); //不区分-和_
                if (strcasecmp($key, $header) == 0) {
                    return $value;
                }
            }
        }
        return null;
    }
266425
private function filterHeader($header)
    {
        $filtered = str_replace('-', ' ', $header);
        $filtered = ucwords($filtered);
        return str_replace(' ', '-', $filtered);
    }
370503
function getHeaderField($header)
	{
		$header = strtoupper($header);

		if ($header == 'ACCEPT')
		{
			return $this->accepts;
		}

		$key = 'HTTP_' . strtoupper($header);

		if (isset($_SERVER[$key]))
		{
			return $SERVER[$key];
		}

		return null;
	}
651870
public function get_response_header($header = null)
    {
        if ($header) {
            return $this->response_headers[strtolower($header)];
        }
        return $this->response_headers;
    }