php output garbled characters

Release: 2023-02-27 19:50:02
Original
3441 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

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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!