$path"; formatoutput($filelist); function formatoutput($x) { foreach ($x as $file) { if (count($file) > 1) { formatoutput($file); } else { echo "$file
"; } } } ?>