Rewrite your function as a recursive function, now this function can list all the files in a given directory and the files within subdirectories.
function Listdir ($path)
{
ChDir ($path);
$d = Dir ($path);
$d->path. "
";
Print "
";
while ($entry = $d->read ()) {
if ($entry <> "." and $entry <> "...") {
$last =filemtime ($entry);
Print "
- ";
$name =is_dir ($entry)? (". $entry):(" ". $entry);
Print $name.---. Date ("Y/m/d h:i:s", $last);
if (Is_dir ($path. " /". $entry)) {
Listdir ($path. " /". $entry);
}
}
}
$d->close ();
Print "
";
}
$listpath = "C:";
Echo $listpath;
Listdir ($listpath);
?>
http://www.bkjia.com/PHPjc/631452.html www.bkjia.com true http://www.bkjia.com/PHPjc/631452.html techarticle rewrite your function as a recursive function, now this function can list all files and subdirectories within a specified directory. function Listdir ($path) {chdir ($path); $d = d ...