Skip to content

Instantly share code, notes, and snippets.

@kastaneda
Created November 12, 2010 09:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kastaneda/673922 to your computer and use it in GitHub Desktop.
Save kastaneda/673922 to your computer and use it in GitHub Desktop.
<?php
$bad_files = array('file1', 'file2', 'file3');
if ($handle = opendir('.')) {
echo '<ul>';
while (false !== ($file = readdir($handle))) {
if ($file[0] == '.') {
continue; // skip dot-files
}
if (in_array($file, $bad_files)) {
continue; // skip 'bad' files
}
if (is_dir($file)) {
$file .= '/';
}
echo "<li><a href=\"$file\">$file</a></li>";
}
echo '</ul>';
closedir($handle);
} else {
echo 'Error';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment