Stefan Baumgartner

Web ops, performance and front-end

Removing Byte Order Marks

18 September 2014 by @ddprrt | Posted in: PHP

One special version of Excel for instance still adds those nasty buggers.

$str = file_get_contents("input_file_with_bom.csv");

$str = str_replace("\xEF\xBB\xBF","",$str);

file_put_contents("output_file_without_bom.csv");

Comments? Shoot me a tweet!