Skip to content

Message: getHeaderLine Example

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



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.


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

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