directory listing

List all the files in a specific directory.

function list_files($dir){
    if(is_dir($dir)){
        if($handle = opendir($dir)){
            while(($file = readdir($handle)) !== false){
                if($file != \".\" && $file != \"..\" && $file != \"Thumbs.db\"*pesky windows, images..*){
                    echo \'\'.$file.\'
\'.\"\\n\"; } } closedir($handle); } } } * To use: *