Thanks jcbones! This works. Last thing though, there are a bunch of .LCK files on the server that I do not want to show up in the list. If there an easy way to edit the coding to make those a no-show?
Here's the code once again:
<?php
function dirContents($dir) {
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
if(in_array($file,array('.','..'))) { continue; }
if(is_dir($dir.'/'.$file)) {
$contents[$dir.'/'.$file] = dirContents($dir.'/'.$file);
} else {
$contents[] = $dir . '/' . $file;
}
}
closedir($dh);
}
}
return $contents;
}
function processArray($array) {
if(is_array($array)) {
echo '<ol>';
foreach($array as $key => $value) {
if(is_int($key)) {
$name = strrchr($value,'/');
echo '<li><a href="'.$value.'">'.substr($name,1).'</a></li>';
}
else {
echo '<li><span style="font-weight:bold">' . $key . '</span>';
processArray($value);
echo '</li>';
}
}
echo '</ol>';
}
}
processArray(dirContents('../../images'));
?>