Created
November 27, 2013 10:18
-
-
Save cezarderevlean/7673511 to your computer and use it in GitHub Desktop.
This file contains 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 | |
$files = array(); | |
$dir = opendir('.'); // open the cwd..also do an err check. | |
while(false != ($file = readdir($dir))) { | |
if(($file != ".") and ($file != "..") and ($file != "index.php")) { | |
$files[] = $file; // put in array. | |
} | |
} | |
natsort($files); // sort. | |
// print. | |
foreach($files as $file) { | |
if (strpos($file,'.html') !== false) { | |
echo("<a href='$file'>$file</a> <br />\n"); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment