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 Description
1

name

It contains the header names set to be deleted

Online Example

Try the following examples 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