header_remove

(PHP 5 >= 5.3.0, PHP 7)
Remove previously set headers
void header_remove ([ string $name ] )

Removes an HTTP header previously set using header().

Parameters:
name

The header name to be removed.

Note: This parameter is case-insensitive.

Returns:

No value is returned.

Notes:

Headers will only be accessible and output when a SAPI that supports them is in use.

Examples:
Unsetting specific header.
<?php
header("X-Foo: Bar");
header("X-Bar: Baz");
header_remove("X-Foo"); 
?>

The above example will output something similar to:

X-Bar: Baz
Unsetting all previously set headers.
<?php
header("X-Foo: Bar");
header("X-Bar: Baz");
header_remove(); 
?>

The above example will output something similar to:

See also:

header() -

headers_sent() -

doc_php
2016-02-24 16:09:44
Comments
Leave a Comment

Please login to continue.