最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
再点一次Active的名,我把你的函数功能扩充了一下,嘻嘻,现在能以树型结构列出整个磁盘上的文件啦。
时间:2008-01-12 编辑:简简单单 来源:一聚教程网
把你的函数改写成递归函数,现在这个函数可以列出某指定目录内的所有文件及子目录内的文件啦。
function listdir($path)
{
chdir($path);
$d = dir($path);
$d->path."
";
print "
}
$listpath="c:";
echo $listpath;
listdir($listpath);
?>
function listdir($path)
{
chdir($path);
$d = dir($path);
$d->path."
";
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 "
while($entry=$d->read()){
if ($entry<>"." and $entry<>".." ){
$last=filemtime($entry);
print "
}
$listpath="c:";
echo $listpath;
listdir($listpath);
?>
相关文章
- python常用的文件操作函数介绍 03-23
- Python文件操作函数详解 11-25
- 文件重命名rename函数用法 05-25
- JAVA文件操作常用函数 10-31
- 一个取得文件扩展名的函数(不过函数名叫做取得FILETYPE呢!呵呵!) 01-12
- 用Api函数播放wav文件 01-12