Reading all the files from a particular directory and displays the files names/Links in a html list. (file ext: .pdf) I'm looking for output something like:
- filename 1
- filename 2
- filename 3
My code:
<ul>
<?php
$dir = '/my_directory_location';
$files = scandir($dir);
foreach ($files as $ind_file) {
?> <li> <a href="<?php echo $dir."/".$ind_file;?>"><?php echo $ind_file;?></li>
<?php } ?>
</ul>
Thanks in Advance