PHP转换文件编码:


$contents_before = file_get_contents($filepath);
$contents_after = mb_convert_encoding($contents_before , 'UTF-8' , 'GBK');
file_put_contents($filepath, $contents_after);