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

WBOY
Release: 2016-06-06 20:49:54
Original
1078 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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!