The following code will list all the file in a directory
<?php
if ($handle = opendir('.')) {
while (false !== ($file = readdir($handle)))
{
if (($file != ".")
&& ($file != ".."))
{
$thelist .= '<LI><a href="'.$file.'">'.$file.'</a>';
}
}
closedir($handle);
}
?>
<P>List of files:</p>
<UL>
<P><?=$thelist?></p>
</UL>
While this is very simple code it does the job.
I'm now looking for a way to list ONLY files that have .xml (or .XML) at the end, how do I do that?