【发布时间】:2012-04-03 14:51:44
【问题描述】:
我有一个字符串,我正在通过 str_replace() 传递,它似乎对我无法弄清楚的编码有一些影响。
示例:
$str = "joined nearly 500 of the world’s investors .."; //shorted exceprt
$str = str_replace(' ', ' ', $str);
var_dump($str);
给予:
joined nearly 500 of the worldÂ’s investors
知道如何防止这种情况发生吗?
【问题讨论】:
-
你有一个聪明的报价,而不是一个标准的撇号。
-
你确定是你的 PHP 出了问题吗?您的 HTML 文件是否正确配置了编码?
-
在这种情况下使用
utf8_encode
标签: php character-encoding iso-8859-1