I am using *file_get_contents* to get some remote text, and the text contains left/right double quoted text such as “Green Slime”.
*file_get_contents* returns this text as �Green Slime�.
Looking at the remote source, the “” characters are literal, not entity codes. There is no character set definition in the source.
Is there a context that I can add to *file_get_contents* to correct this? If not, how can I *str_replace* these characters?
EDIT: Obvious solutions like htmlentities() and str_replace() do not work. I also get the same characters returned when using cURL.
I used
ord()to determine that these characters are chr(147) and chr(148), then usedstr_replace( Chr(147), "“", $str ).Not sure why both file_get_contents and curl return this content in a way that can’t be displayed in a browser.