亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

一個關于本例header的問題

header("content-type:text/html; charset=utf-8"); ?有什么用,什么意思

正在回答

1 回答

請看這段話:

The purpose of the Content-Type field is to describe the data contained in the body fully enough that the receiving user agent can pick an appropriate agent or mechanism to present the data to the user, or otherwise deal with the data in an appropriate manner.


簡單的說,Content-Type這個字段的作用就是:和客戶端說返回的數據是什么類型的,便于客戶端選擇合適的方法處理數據。


樓主上面說的,“content-type:text/html; charset=utf-8”:意思就是告訴瀏覽器,這個是網頁,編碼是utf-8

參考:

http://www.w3.org/Protocols/rfc1341/4_Content-Type.html

0 回復 有任何疑惑可以回復我~
#1

qq_伊始_0

好像有點懂了
2016-08-14 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
PHP進階篇
  • 參與學習       181921    人
  • 解答問題       2668    個

輕松學習PHP中級課程,進行全面了解,用PHP快速開發網站程序

進入課程

一個關于本例header的問題

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號