Home > Backend Development > PHP Problem > What to do if php ie is garbled?

What to do if php ie is garbled?

藏色散人
Release: 2023-03-17 07:54:01
Original
1371 people have browsed it

php IE garbled solution: 1. Set "<meta http-equiv="Content-Type" content="text/html; charset=gb2312">" in the head tag of the web page; 2 . Add the default charset setting information in ".htaccess"; 3. Use the header to set the encoding information of the returned data.

What to do if php ie is garbled?

The operating environment of this tutorial: Windows 7 system, PHP version 8.1, Dell G3 computer.

What should I do if php ie is garbled?

1. Set

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

in the head tag of your webpage. This sentence is the gb2312 encoding

but when I use IE, it automatically selects it. UTF-8, use ff to automatically select gb2312

2. Confirm what the default charset is under Apache, it may conflict with your web page.

Set the encoding of the returned information on the server side:

  • Use .htaccess to add the default charset setting information

  • In PHP, use header to set the encoding information of the returned data

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of What to do if php ie is garbled?. 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