Phly\Http\ServerRequestFactory::getHeader PHP Method

getHeader() public static method

Does a case-insensitive search for a matching header. If found, it is returned as a string, using comma concatenation. If not, the $default is returned.
public static getHeader ( string $header, array $headers, mixed $default = null ) : string
$header string
$headers array
$default mixed
return string
    public static function getHeader($header, array $headers, $default = null)
    {
        $header = strtolower($header);
        $headers = array_change_key_case($headers, CASE_LOWER);
        if (array_key_exists($header, $headers)) {
            $value = is_array($headers[$header]) ? implode(', ', $headers[$header]) : $headers[$header];
            return $value;
        }
        return $default;
    }