Home > Article > Backend Development > How to set encoding in php.ini file
How to set the encoding in the php.ini file: first open the php.ini configuration file; then find and modify the configuration [default_charset = "GB2312"]; and finally restart the server.
Settings about the default character set in php.ini
(Recommended tutorial: php graphic tutorial)
default_charset = "utf-8" mbstring.internal_encoding=utf-8 mbstring.http_output=UTF-8 mbstring.encoding_translation=On mbstring.func_overload=6
Example:
(Video tutorial recommendation: php video tutorial)
If you want to modify the PHP default character set to GB2312, as follows:
vim php.ini default_charset = "GB2312" systemctl restart httpd
The above is the detailed content of How to set encoding in php.ini file. For more information, please follow other related articles on the PHP Chinese website!