好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

php怎么利用header来设置编码

php利用header来设置编码的方法:在脚本头部添加代码【header("content-type:text/html; charset=xxx")】即可。如果要设置utf-8编码,则charset属性的值应为utf-8。

header() 函数向客户端发送原始的 HTTP 报头。

(推荐教程:php图文教程)

示例:

header("content-type:text/html; charset=xxx");

实现代码:

php页面为utf编码

header("Content-type: text/html; charset=utf-8");

(视频教程推荐:php视频教程)

php页面为gbk编码

header("Content-type: text/html; charset=gb2312");

php页面为big5编码

header("Content-type: text/html; charset=big5");

以上就是php怎么利用header来设置编码的详细内容!

查看更多关于php怎么利用header来设置编码的详细内容...

  阅读:38次