Created
October 24, 2024 10:54
-
-
Save coudenysj/b13947580046e5c202bc085acfdc8273 to your computer and use it in GitHub Desktop.
PHP Directory Listing
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 | |
echo '<ul>'; | |
if ($handle = opendir('.')) { | |
while (false !== ($file = readdir($handle))) { | |
if (in_array($file, array('.', '..'))) { | |
continue; | |
} | |
echo '<li><a href="'.$file.'">'.$file.'</a></li>'; | |
} | |
closedir($handle); | |
} | |
echo '</ul>'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment