php运行乱码的解决办法:
PHP文件输出出现乱码
php文件本身的编码与网页的编码应匹配
a. 如果使用gb2312编码,那么php要输出头:
header(“Content-Type: text/html; charset=gb2312")
静态页面添加
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
b. 如果使用utf-8编码,那么php要输出头:
header(“Content-Type: text/html; charset=utf-8")
静态页面添加
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
更多PHP知识,请访问PHP中文网!
以上就是php运行乱码怎么办的详细内容,更多请关注php中文网其它相关文章!
Copyright 2014-2024 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号