Home  >  Article  >  Backend Development  >  Free Image Editing Software PHP Programming Please choose the right text editing software

Free Image Editing Software PHP Programming Please choose the right text editing software

WBOY
WBOYOriginal
2016-07-29 08:35:48861browse

If after you modify any PHP file:
You cannot log in or out;
A blank line appears at the top of the page;
An error warning appears at the top of the page;
Other abnormal situations.
It’s probably an editor problem.
This program uses UTF-8 encoding. Almost all text editing software now can display and edit UTF-8 encoded files. But unfortunately, many of them don't perform well.
Software like Notepad that comes with Windows, when saving a file encoded in UTF-8, will insert three invisible characters (0xEF 0xBB 0xBF, or BOM) at the beginning of the file. It is a string of hidden characters used to let editors such as Notepad identify whether the file is encoded in UTF-8. For ordinary files, this will not cause any trouble. But for PHP, BOM is a big trouble.
PHP does not ignore the BOM, so when reading, including or referencing these files, the BOM will be used as part of the beginning text of the file. According to the characteristics of embedded languages, this string of characters will be executed (displayed) directly. As a result, even if the top padding of the page is set to 0, the entire web page cannot be placed close to the top of the browser, because there are these 3 characters at the beginning of the html!
The biggest trouble is not this. Due to the limitations of the COOKIE sending mechanism, in files that already have a BOM at the beginning of these files, the COOKIE cannot be sent (because PHP has already sent the file header before the COOKIE is sent), so the login and logout functions are invalid. All functions that rely on COOKIE and SESSION are invalid.
Therefore, when editing or changing any text file, please be sure to use an editor that does not add BOM randomly. Editors under Linux should not have this problem. Under WINDOWS, please do not use editors such as Notepad. The recommended editors are:
Editplus version 2.12 or above;
EmEditor;
UltraEdit (the related options of 'Add BOM' need to be canceled);
Dreamweaver (the related options of 'Add BOM' need to be canceled)
etc.
For files that have added BOM, if you want to cancel, you can use the above editor to save it once. (Editplus needs to save as gb first, then save as UTF-8)

The above introduces the free image editing software PHP programming. Please choose the correct text editing software, including the content of free image editing software. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:php predefined constantsNext article:php predefined constants