Skip to content

Message: getHeaderLine Example

Terry L edited this page Jun 20, 2020 · 3 revisions
Clone this wiki locally

Shieldon\Psr7\Message

getHeaderLine($name)

Retrieves a comma-separated string of the values for a single header.

  • param string name * Case-insensitive header field name.
  • return array a string values as provided for the given header concatenated together using a comma. Return empty string if the header dosn't exist.

Example:

echo $this->message->getHeaderLine('user-agent');

// Outputs: Mozilla/5.0 (Windows NT 10.0; Win64; x64)