Home >Backend Development >PHP Problem >How to set encoding in php.ini file

How to set encoding in php.ini file

王林
王林Original
2020-08-18 15:56:313506browse

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.

How to set encoding in php.ini file

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!

Statement:
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