header_remove
(PHP 5 >= 5.3.0)
header_remove — Remove previously set headers
Descrição
void header_remove
([ string
$name
] )Removes an HTTP header previously set using header().
Parâmetros
-
name
-
The header name to be removed.
Note: This parameter is case-insensitive.
Valor Retornado
Não há valor retornado.
Exemplos
Example #1 Unsetting specific header.
<?php
header("X-Foo: Bar");
header("X-Bar: Baz");
header_remove("X-Foo");
?>
O exemplo acima irá imprimir algo similar à:
X-Bar: Baz
Example #2 Unsetting all previously set headers.
<?php
header("X-Foo: Bar");
header("X-Bar: Baz");
header_remove();
?>
O exemplo acima irá imprimir algo similar à:
Notas
Caution
This function will remove all headers set by PHP, including cookies, session and the X-Powered-By headers.
Note:
Headers só serão acessíveis e retornados quando a SAPI que os suporta estiver em uso.
Veja Também
- header() - Send a raw HTTP header
- headers_sent() - Checks if or where headers have been sent