$handle = opendir(‘.’);
while (false !== ($file = readdir($handle))){
$last_modified = filemtime($file);
echo date(“l, dS F, Y @ h:ia”, $last_modified);
}
It will look like something like the above code – do note that i haven’t tested it – but play around – best way is to figure out the best way yourself
$handle = opendir(‘.’);
while (false !== ($file = readdir($handle))){
$last_modified = filemtime($file);
echo date(“l, dS F, Y @ h:ia”, $last_modified);
}
It will look like something like the above code – do note that i haven’t tested it – but play around – best way is to figure out the best way yourself
< ?php
$dir = ".";
$lastModTime = 0;
$fileName = false;
if (!is_dir($dir)) die ("$dir is not a directory!");
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
if (is_file($file)){
$fileLastModTime = filemtime($file);
if ($fileLastModTime > $lastModTime){
$lastModTime = $fileLastModTime
$fileName = $file;
}
}
}
closedir($dh);
}
if ($fileName === false){
print “
No files found.
“;
} else {
printf(“
Last modified file: %s (%s)
“, $fileName,
date(DATE_RFC822, $lastModTime));
}
?>