먼저 폴더의 파일 이름을 확인한 다음 URL을 생성하는 코드를 사용하고 있습니다. 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/>';
}
}
}