从PHP Codeigniter YouTube API数据库解码数据返回NULL

时间:2014-03-29 22:49:25

标签: php json codeigniter youtube-api

我正在尝试使用YouTube API数据中的json_decode(),使用来自Google的CI YouTube库。 能够从file_get_contents($ contents)中检索数据;调用,但无法解析json_decode($ contents)中的数据;它返回NULL。我在api电话中遗漏了什么吗?

$contents = $this->youtube->getPlaylistFeed(.....); // CI yt libs
$cont1 = file_get_contents($contents, TRUE);  // var_dump($cont1); -- has data
$cont2 = json_decode($cont1);                 // var_dump($cont2); -- return NULL

我正在检索数据但我无法解码那些JSON数据。 我如何获得解析数据,如id,title,desc,thumbnail等.... 谢谢你的时间......

0 个答案:

没有答案