Skip to content

Message: withoutHeader Example

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

Shieldon\Psr7\Message

withoutHeader($name)

Return an instance without the specified header.

  • param string name * Case-insensitive header field name.
  • return static

Example:

$message = $message->withHeader('foo', 'bar');

echo $message->getHeaderLine('foo');
// Outputs: bar

$message = $message->withoutHeader('foo');
echo $message->getHeaderLine('foo');
// Outputs: