<?php

if(@file_exists("imgdir")){
    echo "Dir Exists<br/><br/>";
    
    $files = array_diff(scandir("imgdir"), array('.', '..'));
    
    foreach($files as $file){
        echo "{$file}<br/>";
    }
}

