Hello people of WebmasterWorld!
I have this function:-
function ScanDirFiles(Array $FileType){
if($this->populated){
//check that the users supplied dirs are set & have value
if(isset($this->UserDirs) && !empty($this->UserDirs)){
//Foreach dir that is scanned, we need to echo the list of dirs/filenames
//as they appear in the dir tree in explorer:-
/*
folder1
|
---->File1
|
---->File2
|
---->File3
folder2
|
---->File1
|
---->File2
|
---->File3
*/
//only put this here just in case I need to have a count done of total folders
//supplied as a variable (currectly stands at 3)
$CountedDirs = count($this->UserDirs);
//This is the part I can't fathom out:-
//Loop for directory names works fine
foreach($this->UserDirs AS $Key=>$FolderName){
echo $FolderName."<br>";
//loop through dirs and print values to screen that aren't system . or ..
while($GotFiles = readdir(opendir($FolderName))){
if($GotFiles != "." && $GotFiles != ".."){
echo $GotFiles."<br>";
}
}
}
exit;
//terminated script here intentionally
Within the foreach, I want to have another loop which reads the file contents of the folders that have been given up to this point.
I get the folder list, but the only thing I get when I try to run a loop within a loop, is the 60s timeout warning
As it stands there ^^ I have the directory listing working fine, but when I try to pass those values into another loop so that I can process the files that are listed within each given directory, this is where it falls apart.
I just cannot fathom this out - any help or pointers are greatly appreciated.
Cheers,
MRb