Summary and solutions to the problem of garbled Chinese characters in PHP_PHP Tutorial

WBOY
Release: 2016-07-13 10:57:08
Original
1002 people have browsed it

There are a large number of collections and solutions to the problem of Chinese garbled characters in PHP pages. The Chinese garbled characters are generally caused by the inconsistency between the database and the page encoding. Let me directly introduce the solutions to you. ,


1. When creating a database, select utf-8 encoding

2. Select UTF-8 encoding when creating a php file

3. Prevent garbled characters during data transmission mysql_query('set names utf8');

4. Add

to the static page


Personal suggestion: It is recommended that the encoding of the database, php file, and html charset be set to consistent utf-8 before development.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632109.htmlTechArticleThere are a large number of collections and solutions to the problems that cause Chinese garbled characters in PHP pages. The causes of Chinese garbled characters are usually caused by database and page encoding. Caused by inconsistency, let me directly introduce the solution to you...
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template