242011
 

又被BOM这个玩意儿搞得郁闷了一小会。直接上代码吧

function rmBOM($string) {
    if(substr($string, 0,3) == pack("CCC",0xef,0xbb,0xbf)) {
        $string=substr($string, 3);
    }
    return $string;
}

 

 Posted by at 3:20 下午

  One Response to “php删除字符串头部的BOM”

  1. sydkxhpst gkndh pviikjj zqcl ddhcpjpghkqumfj

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>