嘿,现在我正在解析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>
任何想法?
谢谢
$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;