Name

header — send raw HTTP headers

Synopsis

void header(name, value);
string name;
string value;

Description

Adds a raw HTTP header to the list of headers sent back to the browser. The header added is of the form "name: value".

This function should not be called after output has been produced, either through the use of the print() function or through literal HTML code. To do so produces an undefined result.

Example 35. header Example

The code:

header("Pragma", "no-cache");

sends the header:

Pragma: no-cache

in the response, which tells proxy servers not to cache this page.