嘿,现在我正在解析youtube的api
demo url:
http://gdata.youtube.com/feeds/api/videos/-/test?orderby=viewCount&start-index=1&max-results=50
我正在使用simplexml_load_file
问题是,我该怎么做才能找回
<openSearch:totalResults>9477</openSearch:totalResults>
任何想法?
由于
答案 0 :(得分:5)
$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;