我遇到了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