从txt文件中读取的中文及字符内容需要进行转码,不然可能会有乱码

$f=file_get_contents("1.txt");

$f=preg_replace('/d+/', '', $f);
$f=iconv('gb2312','utf-8',$f);
$ff=str_replace("、","@",$f);
echo $ff;

原文地址:https://www.cnblogs.com/xtmp/p/11088631.html