-
-
3. php or html file encoding: use editplus to open the php file or html file. if the database and page encoding are gbk, the encoding here is ansi. if the database and page encoding are UTF-8, then UTF-8 is also used. 4. the data transmitted in javascript or flash is UTF-8 encoded. Note that the data transmitted in javascript or flash is UTF-8 encoded. if the database and page encoding are gbk, transcoding is required, then write the data to the database. Iconv ('utf-8', 'gbk', $ content); 5. You can add a line in the php program to specify the encoding of the php source program:
- Header ('content-type: text/html; charset = gbk ');
-
Php page encoding 1. set encoding in the file header
- @ Header ('content-type: text/html; charset = utf-8 ');
- ?>
2. for the difference between header and meta, use @ header ('content-type: text/html; charset = gbk '); The difference between the two is to tell the browser what encoding is used to display the web page, what is the difference, the header is to send the original http header, not left in the web page, and meta is written in the web page. First, if the webpage does not contain meta, sending the http header will take effect. Second, use the header () function to send the original http header, which can contain more content. encoding is only one of them. Third, in some cases, do not display any content on the webpage, but notify the browser of the encoding used for subsequent actions. |