header_remove

Remove previously set headers

Syntax

header_remove(?string $name = null): void

Parameters

name

The header name to be removed. When null, all previously set headers are removed.

Note: This parameter is case-insensitive.

Return

No value is returned.

Examples

1 · null

<?

header("My-Header-1: Test");
header("My-Header-2: Test");
header("My-Header-3: Test");

header_remove();

print_r(headers_list());

?>
Array
(
)

2 · name

<?

header("My-Header-1: Test");
header("My-Header-2: Test");
header("My-Header-3: Test");

$name = "My-Header-2";

header_remove($name);

print_r(headers_list());

?>
Array
(
    [0] => My-Header-1: Test
    [1] => My-Header-3: Test
)

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

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

PHP

Home Menu