Created
November 7, 2013 14:47
-
-
Save mikedugan/7355782 to your computer and use it in GitHub Desktop.
list certain files by extension
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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