我使用的代碼,首先檢查文件夾中的文件名,然後創建網址。在url中找到它的特殊行,它是一個圖像文件。它顯示正確的圖像和地址,但如果圖像太大,需要很長時間。是否可以創建縮略圖並顯示它而不是圖像?謝謝!PHP來自url的圖片的縮略圖
require_once('simple_html_dom.php');
$files = scandir('files/');
foreach($files as $file) {
if($file == '.' || $file == '..') continue;
$file = basename($file, ".html");
$url = 'http://address.com/test/'.$file;
$html = file_get_html($url);
foreach($html->find('img') as $element) {
if (strpos($element,'address.com') !== false) {
$url = $element->src;
echo $url.'</br>';
echo '<IMG SRC="',$url, '" WIDTH="128" HEIGHT="96" BORDER="0" ALT="" /><br/>';
}
}
}