Home > Backend Development > PHP Problem > What to do if php5.6 gbk is garbled

What to do if php5.6 gbk is garbled

藏色散人
Release: 2023-03-09 21:36:01
Original
1948 people have browsed it

Solution to php5.6 gbk garbled code: First, add the parameter "default_charset=Off" under the php tag of "/etc/php.ini"; then restart the amh environment to take effect.

What to do if php5.6 gbk is garbled

The operating environment of this article: Windows7 system, PHP5.6 version, DELL G3 computer

Under the PHP5.6 version, gbk encoding is not supported , the solution to garbled characters

Under the amh 4.2.1 version developed by our company, the php5.6 version is used. In this version, gbk encoding is not supported by default. If the website is gbk encoded, it will appear Garbled characters.

Cause:

php 5.4.0 The default value for the encoding parameter was changed to UTF-8.
Copy after login

It can be seen that after the php5.4 version, the php encoding has been changed to UTF-8 by default

Solution:

In Add the parameter default_charset = Off under the [php] tag of /etc/php.ini, and then restart the amh environment to take effect

sed -i -e '/[PHP]/a\default_charset = Off' /etc/php.ini
/etc/init.d/amh-start
Copy after login

[Recommended learning: PHP video tutorial]

The above is the detailed content of What to do if php5.6 gbk is garbled. For more information, please follow other related articles on the PHP Chinese website!

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