Trying to only show specific files to my page. I'm returning a thumbs.db file, which is invisible in the directory. I need to only show pdf, docx, or xls files.
<?php
function returnEmpdisDocs()
{
$dir = "empdis/docs/";
$ffs = scandir($dir);
foreach($ffs as $ff)
{
if($ff != '.' && $ff != '..')
{
$filesize = filesize($dir . '/' . $ff);
echo "<li><a download href='$dir/$ff'>$ff</a></li>";
}
}
}
returnEmpdisDocs();
?>
My question is: what can I add to the above code to only include pdf, docx, and xls files?