Home > php教程 > php手册 > php中文乱码问题总结与解决办法

php中文乱码问题总结与解决办法

WBOY
Release: 2016-06-13 09:57:06
Original
868 people have browsed it

导致php页面中中文乱码的问题有大量收集与解决办法,导致中文乱码一般是数据库与页面编码不一致引起的,下面我来给大家直接介绍解决办法。、


1.建立数据库的时候,选择utf-8编码

2.建立php 文件的时候选择UTF-8编码

3.防止数据传输中乱码 mysql_query('set names utf8');

4.在静态页面加上


个人建义:建议在进行开发之前把数据库、php文件、html charset三者的编码设置成一致的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