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

php output garbled characters

Release: 2023-02-27 19:50:02
Original
3620 people have browsed it

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");
Copy after login

2. The html page outputs garbled characters

Set html page character set

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

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