WordPress\AiClient\Providers\Http\Collections

HeadersCollection::getAsStringpublicWP 0.1.0

Gets header values as a comma-separated string.

Method of the class: HeadersCollection{}

No Hooks.

Returns

String|null. The header values as a comma-separated string or null if not found.

Usage

$HeadersCollection = new HeadersCollection();
$HeadersCollection->getAsString( $name ): ?string;
$name(string) (required)
The header name (case-insensitive).

Changelog

Since 0.1.0 Introduced.

HeadersCollection::getAsString() code WP 7.0

public function getAsString(string $name): ?string
{
    $values = $this->get($name);
    return $values !== null ? implode(', ', $values) : null;
}