Remove multiple BOMs from a file

后端 未结 5 869
执念已碎
执念已碎 2020-12-15 10:04

I am using a Javascript file that is a concatenation of other JavaScript files.

Unfortunately, the person who concatenated these JavaScript files together did not us

5条回答
  •  半阙折子戏
    2020-12-15 10:18

    I also figured out this solution which works entirely in PHP:

    $packed = pack("CCC",0xef,0xbb,0xbf);
    $contents = preg_replace('/'.$packed.'/','',$contents);
    

提交回复
热议问题