<html>
<head>
<title>List of files</title>
</head>
<body>
<?php
$thelist = array();
$dir = './';
if ($handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$file = $dir.$file;
$thelist[] = array('file' => $file, 'filemtime' => filemtime($file), 'filesize' => filesize($file));
}
}
closedir($handle);
}
?>
<p>
<table><tr><td><strong>File name</strong></td><td><strong>File Size</strong></td><td><strong>File Last Modification Time</strong></td></tr>
<?php
for($i = 0; $i < count($thelist); $i++) {
?><tr><td><?=$thelist[$i]['file']?></td><td><?=$thelist[$i]['filesize'];?></td><td><?=$thelist[$i]['filemtime'];?></td></tr><?php
}
?>
</table>
</p>
</body>
</html>