Home >Backend Development >PHP Problem >php output garbled characters

php output garbled characters

尚
Original
2019-10-26 16:40:573591browse

php output garbled characters

Solution to the problem of php output Chinese garbled characters

1. PHP page output garbled characters

Method 1

Set the php.ini character set , modify [default_charset = "UTF-8"]

Method 2

Set the default character set at the beginning of the php file

header("Content-Type: text/html;charset=utf-8");

2. The html page outputs garbled characters

Set html page character set

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

The above is the detailed content of php output garbled characters. 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