$handle = opendir($abs_path); if($handle) { while(($file = readdir($handle)) !== false) { if($file == "." || $file == "..") continue; echo $file."<br>"; } closedir($handle); }