Come faccio ad estrarre tutti gli id dei video da questo xml
http://gdata.youtube.com/feeds/api/v...results=10&v=2
Codice PHP:
<?php
function download_page($path){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$path);
curl_setopt($ch, CURLOPT_FAILONERROR,1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
$retValue = curl_exec($ch);
curl_close($ch);
return $retValue;
}
$url='http://gdata.youtube.com/feeds/api/videos?q=football+-soccer&orderby=published&start-index=11&max-results=10&v=2';
$sXML = download_page(url);
$oXML = new SimpleXMLElement($sXML);
//da qui in poi non so che fare
foreach($oXML->entry as $oEntry){
echo $oEntry->id . "\n";
}