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

php中文乱码

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 11:30:18
Original
845 people have browsed it

最近无聊做PHP页面连接mysql

就发现中文乱码

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

 

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

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

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

4.在静态页面加上 

 

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

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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template