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 )
Links
Network
- checkdnsrr
- closelog
- dns_check_record
- dns_get_mx
- dns_get_record
- fsockopen
- gethostbyaddr
- gethostbyname
- gethostbynamel
- gethostname
- getmxrr
- getprotobyname
- getprotobynumber
- getservbyname
- getservbyport
- header
- header_register_callback
- header_remove
- headers_sent
- http_response_code
- inet_ntop
- inet_pton
- ip2long
- long2ip
- openlog
- pfsockopen
- setcookie
- setrawcookie
- socket_get_status
- socket_set_blocking
- socket_set_timeout
- syslog