English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

PHP Basic Tutorial

PHP Advanced Tutorial

PHP & MySQL

PHP Reference Manual

PHP header_remove() function usage and example

PHP HTTP  Reference Manual

The header_remove() function deletes previously set HTTP headers.

Syntax

void header_remove ([ string $name ] )

Definition and usage

Used to delete previously set HTTP headers.

Return value

No value returned

Parameter

Serial numberParameters and descriptions
1

name

It contains the header names set to be deleted

Online example

Try the following example to delete a header and all headers:

<?php
      //Delete specified headers
   header("X-f1: b1");
   header("X-b1: b2");
   header_remove("X-f1"); 
   
    //Cancel all previously specified headers
     header("X-Foo: Bar");
      header("X-Bar: Baz");
      header_remove();   
?>

Output result

X-b1: b2

PHP HTTP  Reference Manual