You are welcome, I feel your pain when it comes to trying to visualize a large file structure.
I didn't have time earlier to play with it more, I had to go do some actual work(sorry for my use of four-letter words in here).
I started working on it again when I got home, took a little time to get my head around the massive array and the recursive functions to build it and then display it.
I wanted to make it a little better, you should find this version much handier viewing in a web page, and it still creates a text file.
It first displays only folder names, you can click on a folder name to expand and show the files in that folder, click again to hide the files.
It also tabs over for each level down a folder is, overall it should give you a much better mental picture of your site structure, and the number of files in each folder is displayed as well.
Added a setting you can change to true to have alternating background colors.
This one by default does not output a text file, change the setting to true to make it output to text file.
Here is a cropped down screen shot of what it looks like in the browser with one folder open showing the 6 files in it:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<style type="text/css">
<!--
.blue{font-weight:bold;color:blue;}
.red{color:red;}
.toggle{
font-weight:normal;
font-size:small;
color:#093;
cursor:pointer;
}
.folder{cursor:pointer;}
a:link{color:black;}
a:visited{color:#999;}
-->
</style>
<script type="text/javascript">
<!--
function toggle(obj){
var child = obj.firstChild;
var sib = child.nextSibling;
while(sib.tagName != 'DIV' && sib.nextSibling){
sib = sib.nextSibling;
}
if(sib.style.display == 'block'){
sib.style.display = 'none';
}else{
sib.style.display = 'block';
}
return;
}
-->
</script>
</head>
<body>
<?php
function folder_list($folder){
global $totalFolders, $totalFiles;
if(!preg_match('/\/$/',$folder)) $folder .= "/";
$currentFolder = opendir($folder);
$all_files['FOLDERS'] = array();
$all_files['FILES'] = array();
$temp_folders = array();
while (false !== ($file = readdir($currentFolder))){
if ($file != "." && $file != ".."){
if(is_dir($folder.$file)){
$totalFolders++;
array_push($temp_folders,$file);
}else{
array_push($all_files['FILES'],$file);
$totalFiles++;
}
}
}
if(count($temp_folders)){
foreach($temp_folders as $new_folder){
$all_files['FOLDERS'][$new_folder] = folder_list($folder.$new_folder);
}
}
return $all_files;
}
function output_directory_structure($directory,$foldername,$tab_level,$bg=0){
global $tab, $handle, $filetab, $bgcolor, $bg, $alternateBackgroundColor, $makeLinks;
$bg = $alternateBackgroundColor ? 1 - $bg : 3;
echo "<div class='foldername' style='background-color:".$bgcolor[$bg]."'>\r";
for($i = 0; $i < $tab_level; $i++){
echo $tab;
if($handle) fwrite($handle,$filetab);
}
echo '<span onclick="toggle(this.parentNode)" class="blue folder">'.$foldername.'</span>';
echo count($directory['FILES']) ? " <span onclick='toggle(this.parentNode)' class='toggle'>[ toggle files <span class='red'>(".count($directory['FILES']).")</span>]</span>" : "";
echo "<br>\r";
echo '<div style="display:none;">'."\r";
if($handle){
fwrite($handle,html_entity_decode($foldername)."\n");
}
if(count($directory['FILES'])){
foreach($directory['FILES'] as $file){
for($i = 0; $i < $tab_level+1; $i++){
echo $tab;
if($handle) fwrite($handle,$filetab);
}
$link = preg_replace('/<root>/','..',$foldername).'/'.$file;
if($makeLinks) echo "<a href='".$link."'>";
echo $file;
if($makeLinks) echo "</a>";
echo "<br>\r";
if($handle) fwrite($handle,$file."\n");
}
}
echo "</div></div>\r";
if($handle) fwrite($handle,"\n");
if(count($directory['FOLDERS'])){
foreach($directory['FOLDERS'] as $key=>$folders){
output_directory_structure($folders,$foldername.'/'.$key,$tab_level+1);
}
}
return;
}
//===============================================================================================//
// set to true if you want alternating background colors
$alternateBackgroundColor = true;
// IF YOU WANT TO OUTPUT A TEXT FILE OF THE STRUCTURE, CHANGE $outputFile to equal true //
$outputFile = false;
// TRUE WILL MAKE HYPERLINKS OUT OF ALL FILES LISTED
$makeLinks = true;
$dir_structure = array();
$bgcolor = array('#eef','#eff','');
$bg = 0;
$totalFolders = 0;
$totalFiles = 0;
$root = $_SERVER['DOCUMENT_ROOT'];
$stime = microtime(true);
if(is_dir($root)) $dir_structure = folder_list($root);
$mtime = microtime(true);
echo "<h3 style='color:blue'>Total Folders: $totalFolders</h3>";
echo "<h3 style='color:blue'>Total Files: $totalFiles</h3>";
$tab = "<span class='blue'>.</span>--------";
$filetab = '.--------';
$handle = false;
if($outputFile) $handle = fopen('web_directory.txt','w');
if($handle){
fwrite($handle,"\n\n========================================================================");
fwrite($handle,"\n\nTotal Folders: $totalFolders\nTotal Files: $totalFiles");
fwrite($handle,"\n\n========================================================================\n\n");
}
output_directory_structure($dir_structure,'<root>',0);
$etime = microtime(true);
echo "Time to build data structure: ";
echo $mtime-$stime;
echo "<br>Time to create web page from data: ";
echo $etime-$mtime;
echo "<br>Total time: ";
echo $etime-$stime;
if($handle) fclose($handle);
?>
</body>
</html>
** UPDATE: added setting to make hyperlinks out of every file listed, default is TRUE.