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

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

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

posted @ 2019-06-26 10:57  虚幻的街景  阅读(774)  评论(0编辑  收藏  举报