What Is A bom header)

Source: Internet
Author: User

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!

========================================================== ========================================================== ========================

If the window editor is saved as a utf8 file, the BOM header will be added for you to tell other editors to display characters using utf8.

However, you do not need to add BOM header identification on the webpage, because you can use head header to specify charset = utf8 to tell the browser to use utf8 for explanation. however, you can use the window automatic editor to edit and display the three characters 0xef 0xbb on the webpage.

In this way, 0xef 0xbb 0xbf needs to be removed from the webpage. You can use editplus to select the code without Bom.

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.