Iterating through folders
<p>I have been using a snipit I found online to display the files and folders in a directory with my PHP script. This part works fine, but I would like to be able to click the folders and get a similar html page up that displays it's contents, and beeing able to open the text files in the browser(this works fine if the text file is in the start directory).</p>

<p>At the moment, when I click a folder, an old school sort of page opens up with no html file in it. Is the only way to do this to create a new PHP script in each folder and link to it? I tried using the DirectoryIterator class, but it gave me an error. I dont have the snipit for DirectoryIterator anymore, but it was something like "Can't find class DirectoryIterator".</p>

<p>Here's the code I'm using now(working):</p>

<pre><code>$arrayImports = array ();

if ($handle = opendir ($importLogPath)
{
while (false !== ($entry = readdir ()))
   {
       chop ($entry);
       if ($entry != "."  $entry != "..")
       {
          $arrayImports [] = "&lt;p&gt;&lt;a href=$importLogPath$entry target=_blank&gt;$entry&lt;/a&gt;&lt;/p&gt;";
       }
    }
   closedir($handle);
}

arsort ($arrayImports);
foreach ($arrayImports as $value)
{
  print "&lt;li&gt;$value&lt;/li&gt;";
}
</code></pre>

<p>Thanks!</p>
