最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
如何扫描一个目录下的所有文件阿
时间:2009-03-07 编辑:简简单单 来源:一聚教程网
将一个目录下面的所有的html列出来
当作连接显示
// Note that !== did not exist until 4.0.0-RC2
if ($handle = opendir('/path/to/files')) {
echo "Directory handle: $handlen";
echo "Files:n";
/* This is the correct way to loop over the directory. */
while (false !== ($file = readdir($handle))) {
echo "$filen";
}
/* This is the WRONG way to loop over the directory. */
while ($file = readdir($handle)) {
echo "$filen";
}
closedir($handle);
}
?>
相关文章
- Shell脚本监控目录内文件改动的代码 05-11
- Python对文件和目录进行操作(file对象/os/os.path/shutil 模块) 05-09
- vim中表示当前目录和当前文件名的方法 10-23
- python在目录中查找指定文件实现代码 10-10
- file_exists -检查文件或目录是否存在 04-27
- 列出指定目录下的所有文件和目录 01-12