Header
in package

This class will manage the headers that PHP will send to the response (not the received ones).

Tags
see
Header::set()
see
Header::get()
see
Header::getAll()
see
Header::exist()
see
Header::unset()
see
Header::clear()

Table of Contents

clear() Unsets all the available headers.  : void
exist() Checks if the header identified by the given key exists.  : bool
get() Returns the value on the given header key.  : string|null
getAll() Returns all the stored headers.  : array<string|int, mixed>
set() Sets a header with the given key and value.  : void
unset() Unsets the header with the given key.  : void

Methods

clear()

Unsets all the available headers.

public static clear() : void
Return values
void

exist()

Checks if the header identified by the given key exists.

public static exist(string $key) : bool
Parameters
$key : string

Name of the header you want to check.

Return values
bool

get()

Returns the value on the given header key.

public static get(string $key) : string|null
Parameters
$key : string

Name of the header you want to get.

Return values
string|null

getAll()

Returns all the stored headers.

public static getAll() : array<string|int, mixed>
Return values
array<string|int, mixed>

set()

Sets a header with the given key and value.

public static set(string $key, string $value) : void
Parameters
$key : string
$value : string
Return values
void

unset()

Unsets the header with the given key.

public static unset(string $key) : void
Parameters
$key : string
Return values
void

Search results