Php去除Bom

WBOY
Release: 2016-06-23 13:40:55
Original
898 people have browsed it

有时候文件因为是utf8有bom编码的方式,在一些情况下会产生错误。需要去除bom标记。

php代码:

$string = preg_replace( '/^(\xef\xbb\xbf)/', '', $string );
Copy after login


Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template