最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php 浏览目录opendir函数
时间:2010-11-24 编辑:简简单单 来源:一聚教程网
$dir = opendir("images");
//列出 images 目录中的文件
while (($file = readdir($dir)) !== false)
{
echo "filename: " . $file . "
";
}
closedir($dir);
// 看一下改装的目录浏览实现,使用表格浏览目录的结构
print("n");
n");
// 创建表格的头
print("n"); n");
print("文件名 n");
print("文件的大小 n");
print("
$mydirectory = opendir("."); // 建立操作目录的句柄
// 读出目录中的每一个子项
while($entryname = readdir($mydirectory))//通过循环,访问目录的每一个文件
{
print(""); n");
print("$entryname ");
print(""); ");
print(filesize($entryname));//返回文件大小
print("
print("
}
closedir($mydirectory); // 关闭目录
print("
-
下一个: php文件缓存技术实现代码
相关文章
- php目录操作函数总结 04-24
- php中require_once()函数相对目录要谨慎 07-21
- php mkdir函数用法与mkdir创建目录 05-05
- php opendir 打开目录函数 12-02
- php 创建目录函数教程 10-27
- php chdir 改变目录函数教程 04-25