Created
July 10, 2014 09:23
-
-
Save fffaraz/74a2b5ac20862bf43b35 to your computer and use it in GitHub Desktop.
php file listing
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
<table border="1"> | |
<th><td>File</td><td>Size</td></th> | |
<?php | |
$files = scandir("."); | |
$i = 0; | |
foreach($files as $entry) | |
{ | |
if($entry == '.' || $entry == '..' || $entry == 'index.php') continue; | |
echo '<tr>'; | |
echo '<td>' . ++$i . '</td>'; | |
echo '<td><a href="' . $entry .'">' . $entry . '</a></td>'; | |
echo '<td>' . round(filesize($entry) / 1024) . '</td>'; | |
echo '</tr>'; | |
echo "\n"; | |
} | |
?> | |
</table> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment