@param string $header

@return string
163440
public static function getHeaderStatus(string $header): string
    {
        $pos = strpos($header, "\r\n");

        return $pos === false ? '' : substr($header, 0, $pos);
    }
752182
private function normalizeHeaderName($header)
    {
        if (strpos($header, 'HTTP_') === 0) {
            $header = str_replace('_', '-', substr($header, 5));
        }
        return strtolower($header);
    }
1271531
public function getHeaderLine(string $header): ?string
    {
        $headers = $this->header->get($header);

        return $headers === [] ? null : \implode(', ', $headers);
    }
528887
private function header2String($header)
    {
        $str = '';
        if (is_array($header)) foreach ($header as $k=>$v) {
            if (is_numeric($k)) continue;
            $str .= $k . ': ' . $v . "\r\n";
        } else {
            $str = $header;
        }
        return $str;
    }
288211
private function parseHeader($header)
    {
        $res = preg_match_all('/(?:[^,"]*+(?:"[^"]*+")?)+[^,"]*+/', $header, $matches);

        if (!$res) {
            throw new InvalidHeader(sprintf('Failed to parse accept header: "%s"', $header));
        }

        return array_values(array_filter(array_map('trim', $matches[0])));
    }
1308711
public function findHeaderIndex($header)
    {
        $xpath = $this->findHeader($header)->getXpath().'/preceding::*';

        return count($this->getPage()->findAll('xpath', $xpath)) + 1;
    }
1027118
protected function prepareRequestHeader(Header $header): array
    {
        $result = [];
        foreach ($header as $name => $value) {
            $result[] = $name . ': ' . $value;
        }
        return $result;
    }
395005
public function getHeader($header)
    {
        if (array_key_exists($header, $this->responseHeaders)) {
            return $this->responseHeaders[$header];
        }
        // Do case-insensitive search
        foreach ($this->responseHeaders as $k => $v) {
            if (strtolower($k) == strtolower($header)) {
                return $v;
            }
        }
    }
463102
public function getHeader($header, $default = null) 
    {
        $name = strtoupper(str_replace('-', '_', $header));
        if (substr($name, 0, 5) != 'HTTP_') {
            $name = 'HTTP_' . $name;
        }
        
        if (($header = $this->getServer($name)) != null) {
            return $header;
        }
        
        return $default;
    }
1219015
function getHeaderValue($header){
		$header = strtolower($header);
		$headers = $this->getResponseHeaders(array("as_hash" => true, "lowerize_keys" => true));
		if(isset($headers["$header"])){ return $headers["$header"]; }
	}
10246
public function header($header)
    {
        if ($header instanceof HeaderInterface) {
            $header = $header->toString();
        }

        if (empty($header)) {
            return $this;
        }

        header((string) $header);

        return $this;
    }
61593
final protected function parseIncomingRaw($header)
    {
        $retval = array();
        $content = "";
        $fields = explode("\r\n", preg_replace('/\x0D\x0A[\x09\x20]+/', ' ', $header));
        foreach ($fields as $field) {
            if (preg_match('/([^:]+): (.+)/m', $field, $match)) {
                $match[1] = preg_replace_callback('/(?<=^|[\x09\x20\x2D])./', function ($matches) {
                    return strtoupper($matches[0]);
                }, strtolower(trim($match[1])));
                if (isset($retval[$match[1]])) {
                    $retval[$match[1]] = array($retval[$match[1]], $match[2]);
                } else {
                    $retval[$match[1]] = trim($match[2]);
                }
            } else if (preg_match('!HTTP/1\.\d (\d)* .!', $field)) {
                $retval["status"] = $field;
            } else {
                $content .= $field . "\r\n";
            }
        }
        $retval['content'] = $content;

        return $retval;
    }
14808
public static function extractPluralsForms($header)
    {
        $headers = explode("\n", $header);
        $expr = 'nplurals=2; plural=n == 1 ? 0 : 1;';
        foreach ($headers as $header) {
            if (stripos($header, 'Plural-Forms:') === 0) {
                $expr = substr($header, 13);
            }
        }

        return $expr;
    }
360869
public function getHeader(string $header, string $default=''): string
  {
    return array_change_key_case( $this->headers, CASE_LOWER)[ strtolower($header) ] ?? $default;
  }
568964
public static function getHeader($header) {

		$headers = static :: getHeaders();

		if(true === isset($headers[$header])) {
			return $headers[$header];
		}

		return null;
	}
201140
private function getHeaderIp(string $header)
    {
        foreach (array_reverse(array_map('trim', explode(',', $header))) as $ip) {
            if (self::isValid($ip) && !$this->isInProxiedIps($ip)) {
                return $ip;
            }
        }
    }
321994
protected function dispatchHeaderValue($header)
    {
        $header = explode(':', $header, 2);

        if (count($header) < 2) {
            return null;
        }

        return array(
            'name' => trim($header[0]),
            'value' => trim($header[1]),
        );
    }