<?php$dir_path = 'your_directory';$filename = array();$dir = dir($dir_path);while($file = $dir->read()) { if(!ereg('(^\.$)|(^\.\.$)', $file)) { $filename[] = $file; }}$dir->close();?>