我遇到了PHP(5.2)无法在字符串中找到字符''的问题,虽然它显然存在。PHP和字符编码问题Â字符
我意识到底层问题与字符编码有关,但不幸的是我无法控制源内容。我收到它作为UTF-8,这些字符已经在字符串中。
我只是想从字符串中删除它。 strpos(),str_replace(),preg_replace(),trim()等无法正确识别它。
我的字符串是这样的:前
"� � � A lot of couples throughout the World"
我甚至尝试函数utf8_encode()和utf8_decode():
"Â Â Â A lot of couples throughout the World "
如果我这样做:
$string = str_replace('Â','',$string);
我得到这个str_replace,没有运气。
解决方案是什么?我已经抛出所有我能找到它......
为£:$输入= str_replace函数( “£”, “£”,$输入); – atwellpub 2010-12-15 05:23:02