PHP uses headers to set Content-type and common file types Content-type
PHP uses headers to set Content-type and common file types Content-type
In PHP, you can send header information through the header function, you can also set the file Content-type, the following collation of some common file types for the Content-type value.
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 last modified $time = time ()-60; or Filemtime ($FN), etc header (' 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 '); Disables the cache 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 past header (' 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 '); print ' Text that would be displayed if the user hits cancel or '; print ' enters wrong login data ';
http://www.bkjia.com/PHPjc/1023582.html www.bkjia.com true http://www.bkjia.com/PHPjc/1023582.html techarticle PHP uses headers to set Content-type and common file types Content-type PHP using headers to set Content-type and common file types Content-type In PHP, you can use the header function to ...