PHP Read all files in folder

<?php
$dir = “.”;
$projects = scandir($dir);
foreach($projects as $file) { if($file==’.’ or $file==’..’) continue;
?>
<div style=”width: 40%; float: left;clear: none; height: 25px”><a href=”<?php echo $file ?>”><?php echo $file ?></a></div>
<?php } ?>

Leave a Reply

Your email address will not be published. Required fields are marked *