Menu Home

header_remove

osbo.com | PHP | Functions | header_remove

Remove previously set headers

Syntax

header_remove ([ string $name ] ) : void

Parameters

name

The header name to be removed. Note: This parameter is case-insensitive.

Return

No value is returned.

Examples

1

<?

header("X-Test: Stuff");
header("X-Stuff: Please");
header_remove("X-Test");

print_r(headers_list());

?>
Array
(
    [0] => X-Powered-By: PHP/7.4.11
    [1] => X-Stuff: Please
)

2

<?

header("X-Test: Stuff");
header("X-Stuff: Please");
header_remove();

print_r(headers_list());

?>
Array
(
)

PHP