Select the correct text editing software for PHP programming.

Source: Internet
Author: User
For PHP programming, please select the correct text editing software if you occur after modifying any PHP file:

You cannot log on or log out;
A blank line appears at the top of the page;
An error warning is displayed on the top of the page;
Other abnormal situations.
Most of them are editor problems.

This program uses UTF-8 encoding. Now, almost all text editing software can display and edit UTF-8-encoded files. However, unfortunately, many of them are not doing well.

Similar to WINDOWS Notepad and other software, when saving a file encoded in UTF-8, it inserts three invisible characters (0xEF 0xBB 0xBF, BOM) at the beginning of the file ). It is a string of hidden characters, used for the notepad editor to identify whether the file is encoded in UTF-8. For general files, this will not cause any trouble. However, BOM is a big headache for PHP.

PHP does not ignore the BOM. Therefore, when reading, including, or referencing these files, the BOM is used as part of the beginning body of the file. According to the characteristics of the embedded language, this string of characters will be directly executed (displayed. As a result, even if the top padding of the page is set to 0, the whole web page cannot be placed close to the top of the browser, because there are three characters at the beginning of html!

This is not the biggest problem. Due to restrictions of the COOKIE sending mechanism, cookies cannot be sent to files with BOM at the beginning of these files (because PHP has already sent the file header before the COOKIE is sent ), therefore, the logon and logout functions are invalid. All functions dependent on cookies and sessions are invalid.

Therefore, when editing or changing any text files, you must use an editor without adding BOM. The editor in Linux should have no such problem. In WINDOWS, do not use notepad or other editors. The recommended editor is:
Editplus version 2.12 or later;
EmEditor;
UltraEdit (you need to cancel the related options of 'add BOM );
Dreamweaver (you need to cancel the related options of 'add BOM)
.

If you want to cancel a file that has been added with BOM, you can use the editor above to save it again. (Editplus needs to be saved as gb first, then as UTF-8)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.