I want to delete the BOM from my imported file, but it just doesn\'t seem to work.
I tried to preg_replace(\'/[\\x00-\\x1F\\x80-\\xFF]/\', \'\', $file);
Read data with file_get_contents
then use mb_convert_encoding
to convert to UTF-8
$filepath = get_bloginfo('template_directory')."/testing.csv";
$fileContent = file_get_contents($filepath);
$fileContent = mb_convert_encoding($fileContent, "UTF-8");
$lines = explode("\n", $fileContent);
foreach($lines as $line) {
$conls = explode(";", $line);
// etc...
}