Home > Backend Development > PHP Problem > Solve the problem that php does not support Chinese insertion

Solve the problem that php does not support Chinese insertion

hzc
Release: 2023-03-01 12:10:01
Original
3163 people have browsed it

Solve the problem that php does not support Chinese insertion

Solution to the problem that PHP does not support Chinese insertion:

I am thinking that your MySQL data encoding may be gbk. Possible solutions:

  • Execute before executing the insert statement: mysql_query("set names utf8");//Set the MySQL language to utf-8;

  • php can Use basedao_encode($Str) to force conversion to utf-8 encoding, that is, execute after obtaining the variable, and then insert.

#The price is: the data takes up about % more space than the original data.

Recommended tutorial: "php tutorial"



The above is the detailed content of Solve the problem that php does not support Chinese insertion. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
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