Header constructor. name is mandatory, if a value is provided, it will be set.
Parameters
string
$name
string|array|null
$value
getName()
getName() : string
Returns the name of the header, in the same case it was set.
Returns
string
getValue()
getValue() : array|null|string
Gets the raw value of the header. This may return either a string
of an array, depending on whether the header has multiple values or not.
Returns
array|null|string
setName()
setName(string $name) : $this
Sets the name of the header, overwriting any previous value.
Parameters
string
$name
Returns
$this
setValue()
setValue(null $value = null) : $this
Sets the value of the header, overwriting any previous value(s).
Parameters
null
$value
Returns
$this
appendValue()
appendValue(null $value = null) : $this
Appends a value to the list of values for this header. If the
header is a single value string, it will be converted to an array.
Parameters
null
$value
Returns
$this
prependValue()
prependValue(null $value = null) : $this
Prepends a value to the list of values for this header. If the
header is a single value string, it will be converted to an array.
Parameters
null
$value
Returns
$this
getValueLine()
getValueLine()
Retrieves a comma-separated string of the values for a single header.
NOTE: Not all header values may be appropriately represented using
comma concatenation. For such headers, use getHeader() instead
and supply your own delimiter when concatenating.
__toString()
__toString() : string
Returns a representation of the entire header string, including
the header name and all values converted to the proper format.