<?php
$dir = 'img';
$imagesExtensions = array('jpg', 'jpeg', 'gif', 'png');
$files = scandir($dir);
foreach($files AS $file) {
$name = str_replace('.jpg', '', basename($file));
$fileinfo = pathinfo($file);
if(is_file($dir.'/'.$file) && in_array($fileinfo['extension'], $imagesExtensions)) {
echo '<img src="'.$dir.'/'.$file.'" alt="" />';
echo '<div class="bol">'.$name.'</div>';
}
}
?>
Zrobione :D