PHP and character encoding problem with  character

rearCropsharf

New Member
I'm having a problem where PHP (5.2) cannot find the character '?' in a string, though it is clearly there.I realize the underlying problem has to do with character encoding, but unfortunately I have no control over the source content. I receive it as UTF-8, with those characters already in the string.I would simply like to remove it from the string. strpos(), str_replace(), preg_replace(), trim(), etc. Cannot correctly identify it. My string is this:\[code\]"? ? ? A lot of couples throughout the World "\[/code\]If I do this:\[code\]$string = str_replace('?','',$string);\[/code\]I get this:\[code\]"?? ?? ?? A lot of couples throughout the World"\[/code\]I even tried utf8_encode() and utf8_decode() before the str_replace, with no luck.What's the solution? I've been throwing everything I can find at it...
 
Back
Top