public static function getHeader(string $header, array $headers, $default = null): string
    {
        $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;
    }
public static function getHeader(string $header, array $headers, $default = null): string
    {
        $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;
    }
public static function getHeader ( string $ header , array $ headers , $ default = null ) : string { $ 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 ; }
Search for a header value.

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.

@param string $header
@param array  $headers
@param mixed  $default

@return string
Search for a header value .