无法使用file_get_contents()以正确的格式获取json

I parse a parameter to a php file and try to get json with file_get_contents(). This is my Code:

< ?php
    $url = $_GET['url'];
    $url = urldecode($url);
    $json = file_get_contents($url, true);
    echo($json);
? >

This is the called URL: http://vimeo.com/api/v2/channel/photographyschool/videos.json

This is a part of my result:

[{"id":40573637,"title":"All For Nothing - \"Dead To Me\" & \"Twisted Tongues\""}]

And so on... So everything is escaped. There are even in the result.

Since I neet to work afterwards with the json (in js), I need a non escaped version!

Interesting thing is, that my code works for example with this json: http://xkcd.com/847/info.0.json

What is my problem?

查看全部
douliudong8108
douliudong8108
2012/05/03 19:41
  • json
  • php
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

4个回复