Get the values of an HTTP header.

@param string $name
HTTP header name. For example, `Location`. Case-insensitive.

@return array
Values of the HTTP header.
976699
public function get($name)
    {
        if (is_null($name) || empty($name))
        {
            return null;
        }

        $loweredKey = strtolower($name);

        if (array_key_exists($loweredKey, $this->keyMap) === false)
        {
            return null;
        }

        $originalKey = $this->keyMap[$loweredKey];

        return $this->headerMap[$originalKey];
    }
1041923
private function detectResponseHeaderValue($name)
    {
        $headers = $this->getResponseHeaders();

        return isset($headers[$name]) ? $headers[$name] : null;
    }
1047444
public function get($name)
    {
        return isset($this->value[$name])
            ? $this->value[$name]
            : null;
    }
214120
public function getHeaders(string $name = null)
    {
        if (is_null($name)) {
            return $this->get('headers');
        }

        return $this->get('headers', $name);
    }
473331
public function getValue(string $name)
    {
        if (isset($this->valuesAsArray[$name])) {
            return $this->valuesAsArray[$name];
        }

        if (!array_key_exists($name, $this->values)) {
            return null;
        }

        $return = $this->values[$name]['value'] ?? null;

        if ($return === '') {
            $return = null;
        }

        return $return;
    }
436811
public function get($name)
    {
        if (!array_key_exists($name, $this->_values)) {
            return null;
        }

        return $this->_values[$name];
    }
270906
public function header($name)
    {
        $exists = isset($this->headers[$name]);

        return $exists ? $this->headers[$name] : array();

        // getHeader
    }
702261
function FindHeaders($name) {
        $result = array();
        //if ($name[0]<>'/') $name='/^'.$name.'$/';//If regex not found convert it to an "exact phrase" regex as default
        //Return header directly if not written as regular expression (separated for speed)
        if ($name[0] <> '/') {
            if (array_key_exists($name, $_SERVER)){
                $result[$name] = $_SERVER[$name];
            }
        }else {
            //Regular expression headers search
            foreach ($_SERVER as $key => $value) {
                if (preg_match($name, $key, $match)){
                    $result[$key] = $value;
                }
            }
        }
        return $result;
    }
323982
public function getValue($name)
    {
        if (! is_string($name)) {
            return null;
        }

        $bits = explode('.', $name);
        $postData = $_POST;

        foreach ($bits as $key) {
            if (is_array($postData) && isset($postData[$key])) {
                $postData = $postData[$key];
            } else {
                return null;
            }
        }

        return $postData;
    }
85397
public String getHeaderValue(String name) {
        if (headers == null) {
            return null;
        }
        return headers.get(name);
    }
442652
public function getArray($name)
    {
        return isset($this->arguments[$name]) ? $this->arguments[$name]->values() : [];
    }
406082
private List<String> getHeaderValues(String name) {
        List<String> values = headers.get(name);
        if (values == null) {
            values = new ArrayList<String>();
            headers.put(name, values);
        }
        return values;
    }
1260923
public function getValues($name)
    {
        $return = [];
        $items  = $this->getItems();

        foreach ($items as $type) {
            $method = 'get' . ucfirst($name);
            if (method_exists($type, $method)) {
                $return[] = $type->$method();
            } else {
                $return[] = $type->{$name};
            }
        }

        return $return;
    }
1274902
public function getHeader($name)
    {
        if (!$this->hasHeader($name)) {
            throw new \InvalidArgumentException(sprintf('The request header "%s" does not exist.', $name));
        }

        return $this->headers[$name];
    }
140274
protected function getRequestValue($name) {
    $requestValues = $this->getLocalSessionValue(self::REQUEST_VAR);
    return isset($requestValues[$name]) ? $requestValues[$name] : null;
  }
421363
public function getHeader($name)
    {
        $name = mb_strtolower($name);
        return isset($this->headers[$name]) ? $this->headers[$name] : null;
    }
838316
public function getHeader($name)
    {
        if (empty($this->headers)) {
            if (function_exists('apache_request_headers')) {
                $this->headers = apache_request_headers();
            } else {
                $server = $_SERVER;
                foreach ($server as $key => $value) {
                    if (0 === strpos($key, 'HTTP_')) {
                        $key = str_replace('_', '-', strtolower(substr($key, 5)));
                        $this->headers[$key] = $value;
                    }
                }

                if (isset($server['CONTENT_TYPE'])) {
                    $this->headers['content-type'] = $server['CONTENT_TYPE'];
                }

                if (isset($server['CONTENT_LENGTH'])) {
                    $this->headers['content-length'] = $server['CONTENT_LENGTH'];
                }
            }

            $this->headers = array_change_key_case($this->headers);
        }

        $name = str_replace('_', '-', strtolower($name));
        return isset($this->headers[$name]) ? $this->headers[$name] : null;
    }