Home > php教程 > php手册 > PHP页面编码问题

PHP页面编码问题

WBOY
Release: 2016-06-14 00:02:39
Original
1167 people have browsed it
页面编码统一 

MySQL数据库编码、html页面编码、PHP或html文件本身编码要全部一致。
1、MySQL数据库编码:建立数据库时指定编码(如gbk_chinese_ci),建立数据表、建立字段、插入数据时不要指定编码,会自动继承数据库的编码。
数据库连接时,也有编码,可以在连接完数据库后,执行
mysql_query(‘SET NAMES gbk’);//将gbk换成你的编码,如utf8。
2、html页面的编码,指的是这一行的设置:

3銆丳HP鎴杊tml鏂囦欢鏈

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