Home > php教程 > php手册 > php输出内容乱码解决方法

php输出内容乱码解决方法

WBOY
Release: 2016-06-13 11:34:16
Original
1201 people have browsed it

php输出内容包括网页显示及弹出的信息框内容。
乱码一般情况下都是浏览器选择的显示编码与网页的编码方式不同导致的,尽管网站浏览者可以通过手动选择编码来解决乱码问题,但这也大大降低了网站的用户亲和力,况且没多少人懂得如何操作。
解决方法:在php文件的开头添加 header("Content-type: text/html; charset=UTF-8"); UTF-8根据你的网页编码方式自行修改。

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template