RecursiveDirectoryIterator() not showing empty directories
<p>I am trying to use PHP's RecursiveDirectoryIterator to list a set of directories. The issue I am having is that it seems to be skipping any empty directory it hits. Any ideas how to make it list empty directories? </p>

<p>Here is a clip of the code I am using:</p>

<pre><code> $iterator =  new RecursiveIteratorIterator(
                        new RecursiveDirectoryIterator($root));
 $result = array();

 $prefix_length = strlen($root) + 1;
 foreach($iterator as $file)
 {      
   if($file-&gt;isDir())
   {

      $result[] = dirname(substr($file-&gt;__toString(), $prefix_length));
   }
 }
</code></pre>
