开发者

Get Total Results Youtube Api PHP

开发者 https://www.devze.com 2023-03-02 13:31 出处:网络
Hey, well right now I\'m parsing youtube\'s api demo url : http://gdata.youtube.com/feeds/api开发者_JS百科/videos/-/test?orderby=viewCount&start-index=1&max-results=50

Hey, well right now I'm parsing youtube's api

demo url :

http://gdata.youtube.com/feeds/api开发者_JS百科/videos/-/test?orderby=viewCount&start-index=1&max-results=50

i'm using simplexml_load_file

the thing is, what should i do to retrieve the

<openSearch:totalResults>9477</openSearch:totalResults>

any ideas?

Thanks


$feedURL = "http://gdata.youtube.com/feeds/api/videos?q=test&orderby=viewCount&start-index=1&max-results=1";
$sxml = simplexml_load_file($feedURL);
$counts = $sxml->children('http://a9.com/-/spec/opensearchrss/1.0/');
$total = $counts->totalResults;
0

精彩评论

暂无评论...
验证码 换一张
取 消