发现一个处理UTF-8编码文件BOM头的简单方法,在ecshop里面发现的。读取出文件内容后,执行下面代码将BOM去掉:
if (strpos($source, "\xEF\xBB\xBF") !== FALSE) { $source = str_replace("\xEF\xBB\xBF", '', $source); }
Powered by: 博客园 Copyright © 2024 eastson Powered by .NET 9.0 on Kubernetes