//查询编码
$fileType = mb_detect_encoding('字符串',array('匹配的编码)');
//转换编码UTF-8
mb_convert_encoding('字符串','$fileType','UTF-8');
或者
iconv('文件编码','UTF-8','字符串');
PHP对齐读取文件中文乱码
最新推荐文章于 2025-08-04 16:02:56 发布
//查询编码
$fileType = mb_detect_encoding('字符串',array('匹配的编码)');
//转换编码UTF-8
mb_convert_encoding('字符串','$fileType','UTF-8');
或者
iconv('文件编码','UTF-8','字符串');