Organize PHP's header function settings Content-type
Define the coding header (' Content-type:text/html;charset=utf-8 '); Atomheader (' Content-type:application/atom+xml '); Cssheader (' content-type:text/<a href= ' http://www.php1.cn/category/72.html ' >css</a> '); Javascriptheader (' Content-type:text/javascript '); JPEG imageheader (' content-type:image/jpeg '); Jsonheader (' Content-type:application/json '); Pdfheader (' content-type:application/pdf '); Rssheader (' content-type:application/rss+xml; charset=iso-8859-1 '); Text (Plain) header (' Content-type:text/plain '); Xmlheader (' Content-type:text/xml '); Okheader (' http/1.1 OK '); Set a 404 Header: Header (' http/1.1 404 Not Found '); Set the address to be permanently redirected to the header (' http/1.1 301 Moved permanently '); Go to a new address header (' location:http://www.example.org/'); File Delay Steering: header (' refresh:10; url=http://www.example.org/');p rint ' You'll be redirected in seconds '; Of course, you can also use HTML syntax to implement//<meta http-equiv= "Refresh" content= "10;http://www.example.org//>//override x-powered-by : Php:header (' x-powered-by:php/4.4.0 '); header (' x-powered-by:brain/0.6b '); Document Language header (' content-language:en '); Tells the browser that the last modification time is: ()-60; or Filemtime ($FN), Etcheader (' last-modified: '. Gmdate (' d, D M Y h:i:s ', $time). ' GMT '); Tell the browser that the contents of the document did not change the header (' http/1.1 304 not Modified '); Set content Length Header (' content-length:1234 '); Set to a download type header (' Content-type:application/octet-stream '); header (' content-disposition:attachment; Filename= ') Example.zip "'); header (' content-transfer-encoding:binary ');//load the file to Send:readfile (' example.zip '); Disable <a href= "http://www.php1.cn/category/79.html" > Cache </a>header for the current document (' Cache-control:no-cache, No-store, max-age=0, Must-revalidate '); header (' Expires:mon, Jul 1997 05:00:00 GMT '); Date in the Pastheader (' Pragma:no-cache '); Set Content Type: Header (' content-type:text/html; charset=iso-8859-1 '); header (' content-type:text/html; Charset=utf-8 '); Header (' Content-type:text/plain '); Plain Text Format header (' Content-type:image/jpeg '); Jpg***header (' Content-type:applicatiOn/zip '); Zip file header (' Content-type:application/pdf '); PDF file Header (' Content-type:audio/mpeg '); Audio file header (' Content-type:application/x-shockw**e-flash '); Flash animation//Display Login Dialog header (' http/1.1 401 Unauthorized '); header (' Www-authenticate:basic realm= ' Top Secret "');p rint ' Text that would be displayed if the user hits cancel or ';p rint ' enters wrong login data ';