<?php
function displayDir($path)
{
echo "<table border=\"1\">";
echo "<tr>";
echo "<td>文件名</td>";
echo "<td>文件大小</td>";
echo "<td>文件类型</td>";
echo "<td>修改时间</td>";
echo "</tr>";
$dirHandle=opendir($path);
while( $file = readdir($dirHandle) )
{
echo "<tr>";
echo "<td>".$file."</td>";
$filepath=$path."/".$file; //文件具体路径
echo "<td>".filesize($filepath)."</td>";
echo "<td>".filetype($filepath)."</td>";
echo "<td>".date("Y年n月t日",filemtime($filepath))."</td>";
echo "</tr>";
}
closedir($dirHandle);
echo "</table>";
}
?>