注册 登录
编程论坛 PHP技术论坛

求助!!!!!请解答

yongri 发布于 2005-11-12 23:10, 2003 次点击


求助!!!!!


做个程序列出当前目录下的全部文件,包括子目录下的,子目录下也可能 有子目录,要求程序可以找出所有子目录下的文件列出

4 回复
#2
盖茨他爹2005-11-12 23:14
黑客?
#3
yongri2005-11-12 23:45
不是呀,是要求题目,急着解答
#4
faallan2005-11-22 17:00
请看一下dir()函数和isdir()函数
#5
wangshaobo2005-11-29 15:43

if( $_GET["currentdir"] == "" )
{
$currentdir="./";
}
else
{
$currentdir= stripslashes($_GET["currentdir"] );
}
$handle=opendir($currentdir);
while($file=readdir($handle))
{
if(is_dir($currentdir."/".$file))
{
if ($file != "." && $file != "..")
print("<a href=\"".$PHP_SELF."?currentdir=".$currentdir."/".$file."\">".$file."</a>");
}
else
print($file);
}

1