我想從YouTube API獲取有關YouTube頻道的一些信息。從JSON問題中提取數據
這是一例的輸出(使用谷歌的信道),http://gdata.youtube.com/feeds/api/users/Google?alt=json
我正在使用這個JSON:
$json = file_get_contents("http://gdata.youtube.com/feeds/api/users/Google?alt=json");
$data = json_decode($json, true);
我上傳的var_dump($data);
輸出到引擎收錄:http://pastebin.com/CWA7YYGi
我想要的是totalUploadViews
從yt$statistics
。
我迄今爲止嘗試是:
echo $data['yt$statistics']['totalUploadViews'];
但是,這給了我一個錯誤:Notice: Undefined index: yt$statistics
不知道我做錯了,希望得到幫助。