Listing DIRECTORIES script

Discussion in 'PHP' started by wvccboy, Aug 27, 2007.

  1. #1
    I created a script that shows the files in a directory, but I want to show the directories within the directory the script is in only.

    How can I do this?

    Thanks
     
    wvccboy, Aug 27, 2007 IP
  2. dalton

    dalton Peon

    Messages:
    39
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    This one will show folder with the files:

     
    dalton, Aug 27, 2007 IP
  3. wvccboy

    wvccboy Notable Member

    Messages:
    2,632
    Likes Received:
    81
    Best Answers:
    1
    Trophy Points:
    250
    #3
    Hello
    Thanks for that, but I need something that will show the folders within the directory only, and not the files.

    Thanks
     
    wvccboy, Aug 27, 2007 IP
  4. sea otter

    sea otter Peon

    Messages:
    250
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    0
    #4
    
    <?php
            clearstatcache();
    		$dirs = glob('*',GLOB_ONLYDIR);
    ?>
    
    PHP:
     
    sea otter, Aug 27, 2007 IP