" to the php page."/> " to the php page.">

Home >Backend Development >PHP Problem >How to solve the problem of garbled characters in php alert

How to solve the problem of garbled characters in php alert

藏色散人
藏色散人Original
2020-07-08 09:57:412484browse

The way to solve the garbled problem of php alert is to add the statement "97f2b6ae5f4f65bc7d15c6c9b9e8be8c to the php page " is all.

How to solve the problem of garbled characters in php alert

Solution to php alert garbled problem

When making a web website, it is best to use utf8 format for character encoding, gb2312 Traditional Chinese characters are not supported

If it was gb2312 before, you can use emeditor or other editors to save the file as utf8

Each html file must have a header< ;meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

When there is an alert statement in the php page, if If it is not included by other pages with header files, you must add:

header("content-type:text/html; charset=utf-8");

or

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

to the php page so that there will be no garbled code problems.

For more related knowledge, please visit PHP Chinese website!

The above is the detailed content of How to solve the problem of garbled characters in php alert. 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