What should I do if the php page has garbled characters?

藏色散人
Release: 2023-02-24 07:56:02
Original
3618 people have browsed it

What should I do if the php page has garbled characters?

What should I do if the php page has garbled characters?

Solution to garbled php page:

Write at the top of the PHP file:

header('Content-type:text/html;charset=utf-8');
Copy after login

to display Chinese.

or

Open the php.ini file, find; default_charset = "iso-8859-1", change it to: default_charset = "UTF-8" and remove the preceding semicolon (Remove the comments), change the character set to UTF-8, restart the apache service, refresh the page, and the Chinese display will be normal.

Related recommendations: "PHP Tutorial"

The above is the detailed content of What should I do if the php page has 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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!