Skip to content

Instantly share code, notes, and snippets.

@mikedugan
Created November 7, 2013 14:47
Show Gist options
  • Select an option

  • Save mikedugan/7355782 to your computer and use it in GitHub Desktop.

Select an option

Save mikedugan/7355782 to your computer and use it in GitHub Desktop.
list certain files by extension
<?php
//Define directory for files listing
//original example
//$files = glob('/path/to/dir/*.xml');
$files = glob('*.php');
//to limit what is displayed you can use a diff listing:
//$files = array_diff($files, array('index.php','opendb.php'));
foreach ($files as $value) {
echo "<a href=http://changetoyoursite/$value>".$value."</a><br>";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment