2011-04-30 7 views
1

야, 잘 지금 내가 구문 분석있어 유튜브의 API를받기 총 유튜브 API 광고 PHP 결과

데모 URL : 내가

것은이 simplexml_load_file 사용하고

http://gdata.youtube.com/feeds/api/videos/-/test?orderby=viewCount&start-index=1&max-results=50 

, 내가 뭘해야 검색을 위해

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

아이디어가 있습니까?

감사

답변

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; 
+2

내가 ='V를 사용하고 2' 및이 방법이 작동하지 않습니다. 이 아이디어를 어떻게'v2'에서 얻을 수 있을지 생각해보십시오. – mgPePe