If you modify any PHP file after it occurs:
Cannot log in or be logged out;
A blank appears at the top of the page;
An error warning appears at the top of the page;
Other abnormal conditions.
Is mostly an issue with the editor.
This program uses UTF-8 encoding. Now almost all text editing software can display and edit UTF-8 encoded files. Unfortunately, many of these software performance is not ideal.
Software such as Windows-brought Notepad, when saving a UTF-8 encoded file, inserts three invisible characters (0xEF 0xBB 0xBF, or BOM) where the file begins. It is a string of hidden characters that allows editors such as Notepad to identify whether the file is encoded in UTF-8. For general files, this does not cause any trouble. But for PHP, BOM is a big hassle.
PHP does not ignore the BOM, so when you read, include, or reference these files, the BOM is used as part of the text at the beginning of the file. Depending on the characteristics of the embedded language, this string of characters will be executed directly (shown). As a result, even if the top padding of the page is set to 0, there is no way to keep the entire page close to the top of the browser, because there are 3 characters at the beginning of the HTML!
The biggest trouble is not this yet. Limited by the cookie-sending mechanism, where the file has a BOM at the beginning of these files, the cookie cannot be sent out (because PHP has sent the file header before the cookie is sent), so the login and logout functions fail. All the functions that rely on cookies and session implementations are not valid.
Therefore, when editing or changing any text file, be sure to use an editor that does not mess with the BOM. The editor under Linux should not have this problem. Under Windows, do not use editors such as Notepad. The recommended editors are:
EditPlus version 2.12 or above;
UltraEdit (need to cancel the ' Add BOM ' option);
Dreamweaver (need to cancel the ' Add BOM ' option)
For a file that has already been added to the BOM, you can save it with the above editor if you want to cancel it. (EditPlus needs to be saved as GB first and then saved as UTF-8)
The above describes the free image editing software PHP programming Please choose the correct text editing software, including the free image editing software content, I hope that the PHP tutorial interested in a friend to help.