Sh4d03
public text v1 · immutable $path = "/home/allstate/public_html/client"; // <-- Path to the location of files
function getList($path)
{
$dh=opendir($path);
while($file=readdir($dh))
{
if ($file=='.' || $file=='..') continue;
{
$completepath="$path/$file";
}
if (is_dir($completepath))
{
# its a dir, recurse.
getList($path.'/'.$file);
$dirArray[$i] = "Client: $path/$file<br>\n";
$i++;
}
else
{
# its a file.
$listArray[$j] = "-- $path/$file<br>\n";
$j++;
}
}
}