I realized this wasn't excatly what I was looking for. Here is my code:
Code: Select all
<?php
function RecurseDir($basedir, $AllDirectories=array()) {
#Create array for current directories contents
$ThisDir=array();
#switch to the directory we wish to scan
chdir($basedir);
$current=getcwd();
#open current directory for reading
$handle=opendir(".");
while ($file = readdir($handle)) {
#Don't add special directories '..' or '.' to the list
if (($file!='..') & ($file!='.')) {
if (is_dir($file)) {
#build an array of contents for this directory
array_push($ThisDir,$current.'/'.$file);
}
}
}
closedir($handle);
#Loop through each directory, run RecurseDir function on each one
foreach ($ThisDir as $key=>$var) {
array_push($AllDirectories, $var);
$AllDirectories=RecurseDir($var, $AllDirectories);
}
#make sure we go back to our origin
chdir($basedir);
return $AllDirectories;
}
?>
<?
$dirlist=RecurseDir("/var/www/html/Pictures/pictures/Olympus Camedia/");
foreach ($dirlist as $key=>$val) {
// echo $val;
// $up_dir = chdir(../$val);
$all_dir = basename($val);
print "$all_dir <br>";
}
?>done using this script. I need it to display Folder/Sub_Folder (if one exsists). For example...
Diego
Army Pals
Class
carwash
Where the link would point to...
Diego
Diego/Army Pals
Diego/Class
carwash
I don't even know how to begin this idea... Thanks.