Liz*_*ard 2 php string encoding multibyte
我有一个txt文件(根据Notepad ++用ANSI编码的文件),里面有'...'.我在逐行读取文件,我想替换…
为...
我尝试的一切似乎都失败了
$str = htmlentities($str); # trying to convert to … as I can deal with this
$str = mb_ereg_replace("…","...",$str);
$str = str_replace("…", "...", $str);
所有上述都不起作用!我错过了什么,我该如何解决这个问题?
注意:我试图解决此问题的PHP脚本以UTF8编码,php标头为UTF8
在此先感谢您的帮助!
如您所说,它用0x85
文件中的字节表示,请尝试以下方法:
$str = str_replace("\x85", "...", $str);
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
224 次 |
最近记录: |