常用header Content-Type 匯總


header()函數的作用是:發送一個原始 HTTP 標頭[Http Header]到客戶端。標頭 (header) 是服務器以 HTTP 協義傳 HTML 資料到瀏覽器前所送出的字串,在標頭與 HTML 文件之間尚需空一行分隔。在 php中送回 HTML 資料前,需先傳完所有的標頭。

 

常用header匯總:

header('Content-Type: text/html; charset=utf-8'); //網頁編碼

header('Content-Type: text/plain'); //純文本格式

header('Content-Type: image/jpeg'); //JPG、JPEG

header('Content-Type: application/zip'); // ZIP文件

header('Content-Type: application/pdf'); // PDF文件

header('Content-Type: audio/mpeg'); // 音頻文件

header('Content-type: text/css'); //css文件

header('Content-type: text/javascript'); //js文件

header('Content-type: application/json'); //json

header('Content-type: application/pdf'); //pdf

header('Content-type: text/xml'); //xml

header('Content-Type: application/x-shockw**e-flash'); //Flash動畫


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM