PHP replace … with



我有一个txt文件(文件编码在ANSI根据notepad++),其中有'…'。我正在逐行读取文件,我想将替换为...

我所做的一切似乎都失败了

  1. $str = htmlentities($str); # trying to convert to … as I can deal with this
  2. $str = mb_ereg_replace("…","...",$str);
  3. $str = str_replace("…", "...", $str);

以上都不起作用!我错过了什么,我该如何解决这个问题?

注意:我的php脚本,试图解决这个问题是在UTF8编码和php头是UTF8

提前感谢您的帮助!

正如您所说的,它是用字节0x85在文件中表示的,试试这个:

$str = str_replace("x85", "...", $str);

最新更新