How to get folder info on webhosting.?

Discussion in 'PHP' started by Adulu, Mar 20, 2010.

  1. #1
    A folder which there are many subfolder also inside has many files.
    how to get that folder have how many subfolders with files on webhosting.
    as simple as window.

    thank you
     
    Adulu, Mar 20, 2010 IP
  2. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #2
    Nihao,

    Ellaborate?

    To get your document root path you can use:

    <?php
    
    echo $_SERVER['DOCUMENT_ROOT'];
    
    ?>
    PHP:

    To get the path where the current file resides you can do:

    <?php
    
    echo $_SERVER['SCRIPT_FILENAME'];
    
    //or...
    
    echo __FILE__;
    
    ?>
    PHP:
     
    danx10, Mar 20, 2010 IP
  3. Adulu

    Adulu Peon

    Messages:
    2,791
    Likes Received:
    43
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Sorry, i didn't clear explain.

    i mean just like below photo, but it have show how many files not just size.
    [​IMG]

    thank you for reply.
     
    Adulu, Mar 20, 2010 IP
  4. guardian999

    guardian999 Well-Known Member

    Messages:
    376
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #4
    You need recursive php function to get folder info.

    I have sample script.
    I write the code alone.
     
    guardian999, Mar 20, 2010 IP
  5. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0