清空文件的BOM头(PHP代码函数)

来源:互联网 发布:徐州华道数据招聘 编辑:程序博客网 时间:2024/05/29 03:26
//清空文件的BOM头(PHP代码函数)//代码来源:Monxin ./config/functions.phpfunction clear_bom($str){    $charset[1]= substr($str, 0, 1);     $charset[2] = substr($str, 1, 1);     $charset[3] = substr($str, 2, 1);     if(ord($charset[1])== 239 && ord($charset[2]) == 187 && ord($charset[3])== 191){$str=substr($str, 3);}return $str;}

0 0
原创粉丝点击