HomeMenu
Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

headers_list

Description

The headers_list of Network for PHP returns a list of response headers sent (or ready to send).

Syntax

headers_list ( void ) : array

Return

Returns a numerically indexed array of headers.

Examples

1

<?

$return = headers_list();

print_r($return);
Array
(
)

2

<?

// specify plain text
header('Content-type: text/plain');

// define a custom response header - this will be ignored by most clients
header("X-Sample-Test: test");

// setcookie() will add a response header on its own
setcookie('test', 'stuff');

$return = headers_list();

print_r($return);
Array
(
    [0] => Content-type: text/plain;charset=UTF-8
    [1] => X-Sample-Test: test
    [2] => Set-Cookie: test=stuff
)