header_register_callback
Description
The header_register_callback of Network for PHP call a header function.
Syntax
header_register_callback ( callable $callback ) : bool
Parameters
callback
Function called just before the headers are sent. It gets no parameters and the return value is ignored.
Return
Returns TRUE on success or FALSE on failure.
Examples
1
<? header('Content-Type: text/plain'); header('X-Test: test'); function test() { foreach (headers_list() as $header) { if (strpos($header, 'X-Powered-By:') !== false) { header_remove('X-Powered-By'); } header_remove('X-Test'); } } $result = header_register_callback(test()); print_r(headers_list()); echo "a"; ?>
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_remove
- headers_list
- 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