The use of this is to set the encoding, send HTTP status values, and redirect.
PHP Header UTF8:
Header ("content-type:text/html; Charset=utf-8″);
PHP header 404:
Header ("http/1.0 404 Not Found");
The above two examples are set UTF8 encoding and sending 404 status.
Header redirection:
Header (' location:http://www.phpthinking.com ');
Other common header usages:
Header permanent redirect, General 301 used with header location. Header (' http/1.1 301 Moved permanently '); header (' location:http:// www.phpthinking.com/')//Header Delay Refresh page//same as the effect in the HTML page
header (' Refresh:10; url=http:// www.phpthinking.com/');//Header Set Page language header (' content-language:en ');//For the download page, you can declare the file type and filename header (' Content-type: Application/octet-stream '), header (' content-disposition:attachment; filename= ' Filename.zip '); Header (' Content-transfer-encoding:binary ')//header set cache and cache expiration Time header (' Cache-control:no-cache, No-store, Max-age=0, Must-revalidate '); header (' Expires:mon, Jul 1997 05:00:00 GMT ');//Header Set page encoding: header (' content-type:text/html; charset=utf-8′);