This question already has an answer here:
Below is my php code which displays the list of files in my directory with file size
$myDirectory = opendir(".");
// get each entry
while($entryName = readdir($myDirectory)) {
$dirArray[] = $entryName;
}
// close directory
closedir($entryName);
// count elements in array
$indexCount = count($dirArray);
Print ("$indexCount files<br>
");
// sort 'em
sort($dirArray);
// print 'em
print("<TABLE border=1 cellpadding=5 cellspacing=0 class=whitelinks>
");
print("<TR><TH>Filename</TH><th>Filetype</th><th>Filesize</th></TR>
");
// loop through the array of files and print them all
for($index=0; $index < $indexCount; $index++) {
if (substr("$dirArray[$index]", 0, 1) != "."){ // don't list hidden files
print("<TR><TD><a href=\"$dirArray[$index]\">$dirArray[$index]</a></td>");
print("<td>");
print(filetype($dirArray[$index]));
print("</td>");
print("<td>");
print(filesize($dirArray[$index]));
print("</td>");
print("</TR>
");
}
}
print("</TABLE>
");
But now i need to edit to this code so that i can also get "Last modified date" ,, is there a way to fix this?
</div>