<?php $dh = opendir("."); while( $file = readdir($dh) ){ if( $file == "." || $file == ".." ) continue; echo "$file\n"; } closedir($dh); ?>