|
![]() |
名片设计 CorelDRAW Illustrator AuotoCAD Painter 其他软件 Photoshop Fireworks Flash |
|
把你的函数改写成递归函数,现在这个函数可以列出某指定目录内的所有文件及子目录内的文件啦。 <? function listdir($path) { chdir($path); $d = dir($path); $d->path."<br>/n"; print "<ul style=\\'font-size:9pt;\\'>"; while($entry=$d->read()){ if ($entry<>"." and $entry<>".." ){ $last=filemtime($entry); print "<li>"; $name=is_dir($entry)?("<img src=folder.gif>".$entry):("<img src=file.gif>".$entry); print $name." --- ".date("Y/m/d h:i:s",$last); if (is_dir($path."/".$entry)){ listdir($path."/".$entry); } } } $d->close(); print "</ul>"; } $listpath="c:"; echo $listpath; listdir($listpath); ?> 返回类别: 教程 上一教程: PHP程序与服务器端通讯方式小结 下一教程: PHP系统流量分析的程序 您可以阅读与"再点一次Active的名,我把你的函数功能扩充了一下,嘻嘻,现在能以树型结构列出整个磁盘上的文件啦。"相关的教程: · 树型结构列出指定目录里所有文件的PHP类 · 一个取得文件扩展名的函数 · 在GD中输出汉字的函数的改进 · 取得页面所有不重复连接的函数 · 使用"函数递归"实现基于php和MySQL的动态树型菜单 |
![]() ![]() |
快精灵印艺坊 版权所有 |
首页![]() ![]() ![]() ![]() ![]() ![]() ![]() |