phasync
CurlResponse / getHeader

Method

CurlResponse::getHeader

Retrieves a message header value by the given case-insensitive name.

Description#

public CurlResponse::getHeader(
    string $name
): array

This method returns an array of all the header values of the given case-insensitive header name.

If the header does not appear in the message, this method MUST return an empty array.

Parameters#

$name string
Case-insensitive header field name.

Return values#

An array of string values as provided for the given header. If the header does not appear in the message, this method MUST return an empty array. array