PHP garbled code and Sessions verification solution !. When reading Chinese or other language characters in a PHP script is garbled, first check whether your file format is saved in UTF8 encoding format. If not, use UltraEdit... to read Chinese characters or other language characters in PHP scripts, first check whether your file format is saved in UTF8 encoding format. If not, use UltraEdit... and other tools that support UTF8 conversion,
It is best not to use the MS Notepad to directly save it as a conversion. I made this mistake at the beginning.If you are editing in Dreamweaver, follow these steps: Edit
-
-
-> Preferred parameters
-
-
-"Create a document to set the language to UTF8 encoding.
About SESSION verification problems: At first my documents are written in GB2312, and then a website needs to use UTF-8 encoding, I put some of my files in the MS Notepad after opening, save as UTF-8 encoding, did not expect him to add a signature (BOM) in the script program file header so I directly converted the result is wrong:Cannot send session cookie-headers already sent...
After debugging for a long time, we found three solutions:
The first is to use Dreamweaver, UltraEdit... and other tools to convert the source files. this is the most fundamental solution;
The second is to add a "@" in front of the session_start () function.
The third is to open phpinfo () and check whether the parameter Output_buffering is no value. If yes, set it to 1.
Bytes. If not, use UltraEdit...