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.
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">
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!