When the value of the parameter is English can be correctly written to the database, but for the Chinese is not, how to solve the problem of Chinese garbled?
Here's a step-by-step lesson If you solve PHP and AJAX development process, submit the Chinese parameter garbled problem.
The reason for this is because of the format problem passed by the parameter.
Because the English language in the parameter transfer to both sides of the format, so no problem.
In the Chinese state, there are structural combinatorial problems. There are similar traditional types of chaos.
You can solve this:
In JS, the parameters to be passed through encodeURIComponent (Var) first, this function conversion.
The incoming PHP uses $var =iconv ("UTF-8", "GB2312", $_get[' var '), and converts the accepted variable into Chinese.
Finally, when the PHP pass out the parameters of the function $var =iconv ("GB2312", "UTF-8", "Your message"), conversion once. The problem is solved.