<?php
$dir = '.';
$files = scandir($dir);
foreach($files as $n => $str){
if (substr($str, -5) != '.html') unset($files[$n]);
}
sort($files);
foreach($files as $file){
//echo '<br><br>'.$file . '-------------------------------- <br>';
$html = file_get_contents($file);
//preg_match_all('/<img[^>]*?src=\"(.*)\"/iU', $html, $matches); // test
//preg_match_all('/<a[^>]*?href=\"(.*)\"/iU', $html, $matches); // test
// preg_match_all('/https?:\/\/\S+\.(png|jpe?g|gif)/i', $html, $matches); // все изображения с http
preg_match_all('#//[^/]+/(\w+\.(?:jpe?g|png|gif))#i', $html, $matches);
foreach($matches as $lines) foreach($lines as $line) {
if($line == 'png' || $line == 'jpg' || $line == 'jpeg' || $line == 'gif') continue;
echo htmlspecialchars($line)."<br>";
}
//print_r($matches);
}