views:

198

answers:

1

I've got an HTML file with special characters such as:

AT&T™ Official Site

When I use file_get_contents() on the file and echo the contents, I get something like this:

AT&T\u00e2\u0084\u00a2 Official Site

How can I convert the latter to the former?

This is all I'm running:

echo file_get_contents("http://www.google.com/uds/GafsAds?q=att&hl=en&ad=w1&source=gcsc&qid=127c30648069871ea");
+2  A: 

file_get_contents() doesn't parse or decode the content of the file in any way. It only returns you the bytes the file contains as-is (PHP strings are actually strings of bytes, not characters). This encoding is taking place somewhere else.

Matti Virkkunen