ok, ho fatto usando curl:
Codice PHP:
$url = '.............';
$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$html = curl_exec($ch);
$dom = new DOMDocument();
libxml_use_internal_errors(true);
$dom->loadHTML($html);
$imgs = $dom->getElementsByTagName('img');
if ($imgs->length > 0) {
foreach ($imgs as $img) {
echo $img->getAttribute('src');
}
} else {
echo 'Nessun elemento trovato!';
}
evidentemten DOMDocument non accetta url!