In some cases you can use call to a system function LS on Unix or DIR on Windows which hame more options. Here is a simple example:
<?
if(getenv("OS")=="Windows_NT")
{
$tlist1 = shell_exec("cmd /c dir file*.swf /b");
$tlist2 = ereg_replace(" "," ",$tlist1);
$tlist = nl2br($tlist2);
echo "<font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"-3\">\n";
echo $tlist;
echo "</font>";
}
?>
For more information refer manual for LS and DIR commands.