PHP showing directory folders
<p>Im trying to display all the folders that are in a specific directory. Basically so each time a new folder is added, it will show up automatically on the list. Here is what i have so far. I have pieced this together from other posts and doesn't seem to be working and not sure why. I get a nasty error about permissions and none found.</p>

<pre><code>        $dir = '/s/';
        $result = array();

        if (is_dir($dir)) {
                $iterator = new RecursiveDirectoryIterator($dir);
                foreach (new RecursiveIteratorIterator($iterator, RecursiveIteratorIterator::CHILD_FIRST) as $file) {                    
                    if (!$file-&gt;isFile()) {
                        $result[] = 'path: ' . $file-&gt;getPath(). ',  filename: ' . $file-&gt;getFilename();
                    }
                }

        }

        print_r($result);
</code></pre>
