Home >php教程 >php手册 >php中文乱码

php中文乱码

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-13 11:30:18852browse

最近无聊做PHP页面连接mysql

就发现中文乱码

最终解决,现记录下,以日后查阅

 

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

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

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

4.在静态页面加上 

 

注意上面四点应该就可以了.!

Statement:
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