Solution to the problem of php output Chinese garbled characters
1. PHP page output garbled characters
Method 1
Set the php.ini character set , modify [default_charset = "UTF-8"]
Method 2
Set the default character set at the beginning of the php file
header("Content-Type: text/html;charset=utf-8");
2. The html page outputs garbled characters
Set html page character set
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
The above is the detailed content of php output garbled characters. For more information, please follow other related articles on the PHP Chinese website!