配置phpstudy,访问页面的时候出现了中文乱码的状况,以下是解决方案。
一、PHP网页的编码
1、 php文件本身的编码与网页的编码应匹配
a. 如果欲使用gb2312编码,那么php要输出头:header(“Content-Type: text/html; charset=gb2312")
,静态页面添加<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
锛
以上就是php网页中文字符乱码的详细内容,更多请关注php中文网其它相关文章!
Copyright 2014-2024 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号