php method to set gbk encoding: In the head of the PHP file, add the "header("Content-type: text/html; charset=gb2312");" code to declare the content-type and define the web page Encode to gbk encoding and save it.
Recommended: "PHP Video Tutorial"
php set gbk encoding
If you want to use gbk encoding, then php should output the header: header("Content-Type: text/html; charset=gb2312")
, add <meta http-equiv to the static page ="Content-Type" content="text/html; charset=gb2312">
, the encoding format of all files is ANSI, you can open it with Notepad, save as, select the encoding as ANSI, and overwrite the source file.
If you want to use utf-8 encoding, then php should output the header: header("Content-Type: text/html; charset=utf-8")
, add ## to the static page #, the encoding format of all files is utf-8.
header() declares content-type
header(“Content-Type: text/html; charset=gb2312")
Content-Type: text/html; charset=utf-8 Content-Type: multipart/form-data; boundary=something
multipart/form-data: When you need to upload files in a form, you need to use this format
The above is the detailed content of How to set gbk encoding in php?. For more information, please follow other related articles on the PHP Chinese website!