Jump to content

[SOLVED] Getting folder contents?


_OwNeD.YoU_

Recommended Posts

you can use glob

it will give you a array of the files so like this

$dirs = array("dir1","dir2"....);
foreach($dirs as $dir){
    $files = glob($dir ."/*");
    foreach($files as $file){
        echo "$file </br>";
    }
}

also glob can be used like

glob($dir. "/*.txt");

and will only return files ending in .txt

 

Scott,

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.