Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to remove ufeff from php

2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces how to remove uffff in php, which has certain reference value. Interested friends can refer to it. I hope you will gain a lot after reading this article. Let Xiaobian take you to understand it together.

php to remove the uffff method: 1, save the PHP file to no dom format;2, by "function checkBOM($filename){...} "Method Check and remove uffff.

Operating environment: Windows 7 system, PHP7.1 version, DELL G3 computer

php Remove BOM from file\ufeff

Today, I encountered a problem. The data returned by the request interface does not conform to the format. I can't see any problem when printing it with a browser. Finally, I found that the data header has\UFEFF(BOM header). Under search, it is caused by the file encoding format of UTF8-BOM. The editor saves the format incorrectly during development. There are two solutions:

1, the file volume is small, you can use notopad++ to save to no dom format (format-> UTF-8 no dom format)

2. When there are many files, use the following code to repair all files under the specified directory (current directory without parameters) after running.

Thank you for reading this article carefully. I hope that the article "How to remove uffff from php" shared by Xiaobian will be helpful to everyone. At the same time, I hope that everyone will support you a lot and pay attention to the industry information channel. More relevant knowledge is waiting for you to learn!

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: 267

*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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report