解决php或者html中乱码的问题(编码一致)
html里或者php后缀的html文件:
<meta http-equiv="content-type" content="text/html; charset=xxx"> <!--xxx可以为GB2312,GBK,UTF-8-->
这个标签的作用是声明客户端的浏览器用什么字符集编码显示该页面.
在PHP页面里
<?php
//根据你的编码需求只能写一种
//php页面为utf编码
header("Content-type: text/html; charset=utf-8");
//php页面为gbk编码
header("Content-type: text/html; charset=gb2312");
//php页面为big5编码
header("Content-type: text/html; charset=big5");
?>
微信扫一扫,打赏作者吧~