.html文件保存成.php文件之后中文全都是问号。怀疑是php或apache的有关问题,怎么处理

WBOY
Release: 2016-06-13 13:31:34
Original
892 people have browsed it

.html文件保存成.php文件之后中文全都是问号。怀疑是php或apache的问题,怎么办?
如题

------解决方案--------------------

探讨

又是乱码问题……

引用:

乱码问题请检查以下几项编码是否一致:

数据库使用的编码
数据库操作时使用的编码
当前页面使用的编码
文件本身的编码

一致的话就没有问题了。

------解决方案--------------------
文件编码和html的头编码要设置正确





------解决方案--------------------
mysql数据库,php文件内部,php本身都要一至才行。

正确设置:
如:全部都是utf-8
mysql数据库设成utf8 unicode,
php头设为:
最重要的一点:php文件本身要是utf-8编码,默认是ansi.
方法:用记事本打开php文件,另存为:选择utf-8编码。
OK!
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!