In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly shows you "how to remove php bom", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to remove php bom" this article.
The way to get rid of php bom: 1, find the PHP root directory; 2, put the code such as "function checkBOM ($filename) {.}" in the root directory and access it through the browser.
This article operating environment: Windows7 system, PHP7.4 version, Dell G3 computer.
A simple method for PHP to remove BOM
/ * +-+ Title: method of removing BOM header + Author: hello_sgw + Version: V1.0.0.1 + Initial-Time: 2017-08-12 15:18 + Last-time: 2017-08-12 16:01 + Desc: + -* /
When I call the interface, because I use the encapsulation method provided by the other party, I always show errors when outputting a set of data, and finally I think that the method given by the other party may contain coding problems (with BOM headers), so I can search the Internet to find a method to detect BOM and can remove and regenerate the new file, and the data can be displayed normally after use.
What is the head of BOM?
BOM-Byte Order Mark, the Chinese name is translated as "byte order mark". In the utf-8 encoded file, BOM occupies three bytes in the header of the file, which is used to indicate that the file belongs to utf-8 encoding.
There are a lot of software that recognize bom headers, but there are still some that don't recognize bom headers, such as PHP can't recognize bom headers, which is the reason why there will be an error after editing the utf-8 code with notepad.
Solution:
# here the code removes the BOM information of all files in the current directory and word directory by PHP. Just put the code file in the root directory, and then the browser runs and accesses it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.