php简单浏览目录内容的实现代码_php技巧
时间:2021-07-01 10:21:17
帮助过:3人阅读
如下所示:
代码如下:
$dir = dirname(__FILE__);
$open_dir = opendir($dir);
echo "
";
echo "文件名 | 大小 | 类型 | 修改日期 |
";
while ($file = readdir($open_dir)) {
if ($file!= "." && $file != "..") {
echo "" . $file . " | ";
echo "" . filesize($file) . " | ";
echo "" . filetype($file) . " | ";
echo "" . filemtime($file) . " |
";
}
}
echo "
";
?>