Home > Backend Development > PHP Tutorial > mysql - PHP插入数据库数据时汉字被编码存入

mysql - PHP插入数据库数据时汉字被编码存入

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:49:54
Original
1129 people have browsed it

本地(win)测试是正常汉字,但服务器(centos)中存入每个汉字自动转换成类似

<code>试
</code>
Copy after login
Copy after login

的格式.数据库都是utf8,数据插入前也写了$mysqli->set_charset("utf8");文件也是utf8格式的,谷歌了很多没找到解决办法。求助。

这个问题已被关闭,原因:

回复内容:

本地(win)测试是正常汉字,但服务器(centos)中存入每个汉字自动转换成类似

<code>试
</code>
Copy after login
Copy after login

的格式.数据库都是utf8,数据插入前也写了$mysqli->set_charset("utf8");文件也是utf8格式的,谷歌了很多没找到解决办法。求助。

Related labels:
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
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template