2010-04-04 85 views
1

我有特殊字符,如HTML文件:php file_get_contents()..不处理特殊字符?

AT &牛逼™官方网站

当我使用的文件的file_get_contents()和回声的内容,我得到的东西像这样:

AT &牛逼\ u00e2 \ u0084 \ u00a2官方网站

如何将后者转换为前者?

这是所有我运行:

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

你在哪里“得到”?在终端?在浏览器中? – Felix 2010-04-04 13:36:36

+0

来自我的浏览器 – rawrrrrrrrr 2010-04-04 13:50:50

+0

这是什么浏览器? – 2010-04-04 13:53:58

回答

2

的file_get_contents()不解析或解码文件以任何方式的内容。它只返回文件中包含的字节(PHP字符串实际上是字节字符串,而不是字符)。这种编码发生在其他地方。

0

看看Unicode。

也许utf8_decode()可以提供帮助吗? (不知道)