Home >Backend Development >PHP Tutorial >Common problems and solutions to garbled web pages
When we make web pages, we often encounter Chinese garbled web pages. So how to solve this problem? Below, the editor of Script House will share with you four common html web page garbled problems and solutions. Friends in need can refer to Down. I hope to be helpful.
When my colleagues were working on a web page last week, they encountered garbled characters after opening the web page. The colleague was very confused and didn’t know how to solve it. The following is the editor’s time to find out the common garbled HTML web page problems and their solutions. The methods are compiled and shared with everyone.
In fact, there are several main reasons that lead to garbled web pages. The solutions are given below.
1. HTML character encoding problem
This problem is more common, and it is also the most obvious and easiest to solve.
Add in the 93f0f5c25f18dab9d176bd4f6de5d30e of the web page:
##
<meta http-equiv="Content-Type" Content="text/html;charset=utf8"/>
2. PHP character encoding problem
header("Content-type:text/html;charset=utf8");
3. The encoding problem of the file itself
4. Database encoding problem
character_set_connection
character_set_database
character_set_filesystem
character_set_results
character_set_server
character_set_system
character_set_connection
character_set_results
Related recommendations:
php garbled code problem [solution]_PHP tutorial
How to solve garbled characters in ThinkPHP?
utf-8-PHP The persistent problem of garbled codes--partially garbled codes
The above is the detailed content of Common problems and solutions to garbled web pages. For more information, please follow other related articles on the PHP Chinese website!