Home >Backend Development >PHP Problem >How to solve the garbled problem of php echo alert
php echo alert garbled solution: first open the corresponding PHP code file; then add the statement "header("Content-Type:text/html;charset=utf-8")" to the method. Solve the problem of garbled characters.
The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer
How to solve the php echo alert garbled problem?
Specific question:
php echo "3f1c4e4b6b16bbbd69b2ee476dc4f83a alert("Chinese") 2cacc6d41bbb37262a98f745aa00fbf0" Chinese garbled characters~~
I saw someone’s solution was to add
echo "< meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" >";
and I debugged it, but it still didn’t work. Why does this problem occur and how to solve it?
Solution:
Add a header("Content-Type:text/html;charset=utf-8")
to the method Can!
【Recommended learning: PHP video tutorial】
The above is the detailed content of How to solve the garbled problem of php echo alert. For more information, please follow other related articles on the PHP Chinese website!