我正在导入和excel文件(.csv),其中包含阿拉伯字符和英语。当我使用'file_get_contents'提取内容时,一切都很好。
但阿拉伯字符串'يض'出现了????
答案 0 :(得分:0)
file_get_contents
经常曲解UTF8。
你可以尝试这样的事情:
function file_get_contents_utf8($fn) {
$content = file_get_contents($fn);
return mb_convert_encoding($content, 'UTF-8',
mb_detect_encoding($content, 'UTF-8, ISO-8859-1', true));
}