You were close. However, the foreach statement wasn’t used correctly, the use of sizeof doesn’t make any sense, and your echo statement was invalid HTML.
$dir1 = "001/";
$images1 = scandir($dir1);
//if there are items in the directory
if(!empty($images1)){
//for each item found in the directory
foreach ($images1 as $item){
//if the item found is not a directory, is not a symbol for another directory (".." or ".")
if(!is_dir($dir1.$item) && $item != ".." && $item != "."){
//print the image HTML tag
echo '<img src="' . $dir1 . $item . '" alt="">';
}
}
}