PHP Last Update
This piece of code generates a last updated message. It iterates through the directory and finds the newest file with a PHP file extension
<? // open directory $myDirectory = opendir(".");
$Newest = 0;
// get each entry while($entryName = readdir($myDirectory)) { if(strpos($entryName, ".php") > 0) { $Newest = max($Newest, filemtime($entryName)); } }
print("<div CLASS=Footer>Site updated "); print(date("jS M Y", $Newest)); print("</div>");
// close directory closedir($myDirectory); ?>
|