rgb192
asked on
store in a directory/files array
this question is related to
https://www.experts-exchange.com/questions/27998415/all-the-files-in-one-folder-and-all-the-files-that-are-in-that-folder.html
is there a way to put this in an array
so I can differ between
'f'ile
and
'd'ir
and I do a
foreach($array as $key=>$filename){
https://www.experts-exchange.com/questions/27998415/all-the-files-in-one-folder-and-all-the-files-that-are-in-that-folder.html
function readDirs($path){
$dirHandle = opendir($path);
while($item = readdir($dirHandle)) {
$newPath = $path."/".$item;
if(is_dir($newPath) && $item != '.' && $item != '..') {
echo "Found Folder $newPath<br>";
readDirs($newPath);
}
else{
echo ' Found File or .-dir '.$item.'<br>';
}
}
}
$path = "drupal";
echo "$path<br>";
readDirs($path);
is there a way to put this in an array
so I can differ between
'f'ile
and
'd'ir
and I do a
foreach($array as $key=>$filename){
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I want there to be a way to tell which dir the file is in similar to a tree
https://www.experts-exchange.com/questions/27999809/I-want-there-to-be-a-way-to-tell-which-dir-the-file-is-in-similar-to-a-tree.html