小白兔晒黑了

导航

 

1 乱码的类型

2 修改编码的方式

2.1 使用iconv函数

比如把将UTF-8转为GB2312编码

iconv("UTF-8", "GB2312//IGNORE", $v)

2.2 使用header函数

header是设置HTTP请求头的

  • text/plain:纯文本类型

  • text/html:HTML文档类型

  • text/css:CSS样式表类型

  • application/json:JSON数据类型

  • application/xml:XML数据类型

  • application/pdf:PDF文档类型

  • image/jpeg:JPEG图片类型

  • image/png:PNG图片类型

header('Content-Type: application/vnd.ms-execl; charset=utf-8');

 

posted on 2024-08-03 00:57  小白兔晒黑了  阅读(7)  评论(0)    收藏  举报