8.6. HTTP Headers

HTTP headers are special commands sent between the browser and Web server before the browser receives any content. Some of the headers let the server know which file the browser wants. Others may instruct the browser about the type of file it will soon send. To learn more about headers, refer to the HTTP specification, originally described in RFC 1945 and currently described in RFC 2616. It and other documents may be found at the W3C site, which has a section devoted to the HTTP protocol <http://www.w3.org/Protocols/>. For an overview of how headers work with PHP, turn back to Chapter 7.

boolean header(string http_header, boolean replace, integer response)

The header function (Listing 8.9) sends an HTTP header to the browser. ...

Get Core PHP Programming, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.