Headers
class Headers implements Countable, IteratorAggregate
Headers.
Properties
protected array | $headers | Headers. | |
protected array | $acceptableContentTypes | Acceptable content types. | |
protected array | $acceptableLanguages | Acceptable languages. | |
protected array | $acceptableCharsets | Acceptable character sets. | |
protected array | $acceptableEncodings | Acceptable encodings. |
Methods
Constructor.
Returns the numner of headers.
Retruns an array iterator object.
Normalizes header names.
Adds a header.
Returns true if the header exists and false if not.
Gets a header value.
Removes a header.
Returns all the headers.
Parses a accpet header and returns the values in descending order of preference.
Returns an array of acceptable content types in descending order of preference.
Returns an array of acceptable content types in descending order of preference.
Returns an array of acceptable content types in descending order of preference.
Returns an array of acceptable content types in descending order of preference.
Details
at line 72
__construct(array $headers = [])
Constructor.
at line 82
int
count()
Returns the numner of headers.
at line 92
ArrayIterator
getIterator()
Retruns an array iterator object.
at line 103
protected string
normalizeName(string $name)
Normalizes header names.
at line 114
add(string $name, string $value)
Adds a header.
at line 125
bool
has(string $name)
Returns true if the header exists and false if not.
at line 137
mixed
get(string $name, mixed $default = null)
Gets a header value.
at line 147
remove(string $name)
Removes a header.
at line 157
array
all()
Returns all the headers.
at line 168
protected array
parseAcceptHeader(string|null $headerValue)
Parses a accpet header and returns the values in descending order of preference.
at line 212
array
getAcceptableContentTypes(string|null $default = null)
Returns an array of acceptable content types in descending order of preference.
at line 228
array
getAcceptableLanguages(string|null $default = null)
Returns an array of acceptable content types in descending order of preference.
at line 244
array
getAcceptableCharsets(string|null $default = null)
Returns an array of acceptable content types in descending order of preference.
at line 260
array
getAcceptableEncodings(string|null $default = null)
Returns an array of acceptable content types in descending order of preference.