0

I want to make a site where I can upload new folders at will, and then have them automatically added to my menu.

I have a file system looking like this:

procedures
-procedure 1
-folder 1
-folder 2
-procedure 2
-procedure 3
-folder 1
-folder 2
-folder 3

The problem is that I need it to look like this
[ul id="menu1"]
[li]procedure 1[/li]
[ul class="menu2"]
[li]folder 1[/li]
[li]folder 2[/li]
[/ul]
[li]procedure 2[/li]
[li]procedure 3[/li]
[ul class="menu2"]
[li]folder 1[/li]
[li]folder 2[/li]
[li]folder 3[/li]
[/ul]
[/ul]

Anyone got any ideas?

GraphicsMuncher
  • 4,583
  • 4
  • 35
  • 50
  • possible duplicate of [Get the hierarchy of a directory with PHP](http://stackoverflow.com/questions/660644/get-the-hierarchy-of-a-directory-with-php). You only need to apply the [id_dir()](http://www.php.net/manual/es/function.is-dir.php) function to each result to pick only dirs and subdirs. – ffflabs Apr 09 '14 at 22:48
  • 1
    @amenadiel `is_dir()` not `id_dir()` – Rahil Wazir Apr 09 '14 at 22:53

0 Answers0