Remove Bom header: the verification code in thinkPHP cannot be displayed. In a UTF-8 encoded file, BOM occupies three bytes in the file header to indicate that the file belongs to UTF-8 encoding. Currently, many software programs have recognized the bom header, but some cannot recognize the bom header, in a UTF-8 encoded file, BOM occupies three bytes in the file header to indicate that the file belongs to UTF-8 encoding. Currently, many software programs have recognized the bom header, but some cannot recognize the bom header, for example, PHP cannot recognize the bom header, which is also the cause of an error after UTF-8 encoding is edited in Notepad. BOM is only available in WINDOWS when the "notepad" storage for the UTF-8, this can be used to remove the first two bytes with WINHEX. You can set whether to include BOM in the code settings in dreamweaver. generally, BOM will not cause problems as long as the output of php is not an image (GDI Stream. If there are additional characters at the beginning of the GDI Stream, it will be displayed as a Red Cross.
To remove the bom header, there are two simple methods:
1. how to remove the BOM header from editplus
After the editor is adjusted to the UTF8 encoding format, a hidden character (BOM) is added before the saved file, which is used by the editor to identify whether the file is UTF-8 encoded. Run Editplus, click the tool, select preference, select the file, select the UTF-8 ID always delete the signature, and then the php file after editing and saving the php file is without BOM.
2. how to remove the bom header from ultraedit
After opening the file, select the encoding format of the save as option (UTF-8 without bom header) and click OK.
You can also use the Bom. PHP program in the directory to remove the bom header from the php program.
";} Else {$ dirname = $ basedir. "/". $ file; checkdir ($ dirname) ;}}// end whileclosedir ($ dh) ;}// end if ($ dh} // end functionfunction checkBOM ($ filename) {global $ auto; $ contents = file_get_contents ($ filename); $ charset [1] = substr ($ contents, 0, 1 ); $ charset [2] = substr ($ contents, 1, 1); $ charset [3] = substr ($ contents, 2, 1 ); if (ord ($ charset [1]) = 239 & ord ($ charset [2]) = 187 & ord ($ charset [3]) = 191) {if ($ auto = 1) {$ rest = substr ($ contents, 3); rewrite ($ filename, $ rest); return "BOM found, automatically removed. ";} else {return (" BOM found. ") ;}} else return (" BOM Not Found. ");} // end functionfunction rewrite ($ filename, $ data) {$ filenum = fopen ($ filename," w "); flock ($ filenum, LOCK_EX ); fwrite ($ filenum, $ data); fclose ($ filenum) ;}?>
Success ,...