Ver originalforeach(new DirectoryIterator( '/www/test/' ) as $file ) { if(!$file->isDot() ) { echo $file->getFilename(); }}