Hi.
I'd like to display the date when my website was last updated, so I need help with a script who will run through all the files, folders and subfolders, and echo the date of the last updated file.
I have this script which seems to run through the files and folders, but it prints out the name of the last updated file. How do I do it so that it prints out the date?
<?php
function getnewestfile($dir = "./") {
if ($dh = opendir($dir)) {
while ($file = readdir($dh)) {
if ($file == "." || $file == ".." || is_dir($file)) continue;
if (filemtime($file) > $newestfile_time) {
$newestfile = $file;
$newestfile_time = filemtime($file);
}
}
return $newestfile;
} else {
return "";
}
}
echo getnewestfile();
?>
Or is there an easier way?
Thanks in advance.