您的位置:首页 > 编程语言 > PHP开发

php简单浏览目录内容

2013-08-09 23:25 260 查看
<?php
$dir = dirname(__FILE__);
$open_dir = opendir($dir);
echo "<table border=1 borderColor=red cellpadding=6>";
echo "<tr><th>文件名</th><th>大小</th><th>类型</th><th>修改日期</th></tr>";
while ($file = readdir($open_dir)) {
if ($file!= "." && $file != "..") {
echo "<tr><td>" . $file . "</td>";
echo "<td>" . filesize($file) . "</td>";
echo "<td>" . filetype($file) . "</td>";
echo "<td>" . filemtime($file) . "</td></tr>";
}

}
echo "</table>";
?>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: