HeaderInterface
extends
ToArrayInterface, Countable, IteratorAggregate
in
An object that can be represented as an array
Table of Contents
- __toString() : string
- Convert the header to a string
- add() : self
- Add a value to the list of header values
- getGlue() : string
- Get the glue used to implode multiple values into a string
- getName() : string
- Get the name of the header
- hasValue() : bool
- Check if the collection of headers has a particular value
- parseParams() : array<string|int, mixed>
- Parse a header containing ";" separated data into an array of associative arrays representing the header key value pair data of the header. When a parameter does not contain a value, but just contains a key, this function will inject a key with a '' string value.
- removeValue() : self
- Remove a specific value from the header
- setGlue() : self
- Change the glue used to implode the values
- setName() : self
- Change the name of the header
- toArray() : array<string|int, mixed>
- Get the array representation of an object
Methods
__toString()
Convert the header to a string
public
__toString() : string
Return values
string —add()
Add a value to the list of header values
public
add(string $value) : self
Parameters
- $value : string
-
Value to add to the header
Return values
self —getGlue()
Get the glue used to implode multiple values into a string
public
getGlue() : string
Return values
string —getName()
Get the name of the header
public
getName() : string
Return values
string —hasValue()
Check if the collection of headers has a particular value
public
hasValue(string $searchValue) : bool
Parameters
- $searchValue : string
-
Value to search for
Return values
bool —parseParams()
Parse a header containing ";" separated data into an array of associative arrays representing the header key value pair data of the header. When a parameter does not contain a value, but just contains a key, this function will inject a key with a '' string value.
public
parseParams() : array<string|int, mixed>
Return values
array<string|int, mixed> —removeValue()
Remove a specific value from the header
public
removeValue(string $searchValue) : self
Parameters
- $searchValue : string
-
Value to remove
Return values
self —setGlue()
Change the glue used to implode the values
public
setGlue(string $glue) : self
Parameters
- $glue : string
-
Glue used to implode multiple values
Return values
self —setName()
Change the name of the header
public
setName(string $name) : self
Parameters
- $name : string
-
Name to change to
Return values
self —toArray()
Get the array representation of an object
public
toArray() : array<string|int, mixed>