function for displaying last modification time accross more direcotries. e.g. to display last modification date in "about" section of your web page
<?php
function array_prefix_values($prefix, $array)
{
$callback = create_function('$s','return "'.$prefix.'".$s;');
return array_map($callback,$array);
}
function get_last_update()
{
if ( func_num_args() < 1 ) return 0;
$dirs = func_get_args();
$files = array();
foreach ( $dirs as $dir )
{
$subfiles = scandir($dir);
$subfiles = array_prefix_values($dir,$subfiles);
$subfiles = array_filter($subfiles,"is_file");
$files = array_merge($files,$subfiles);
}
$maxtimestamp = 0;
$maxfilename = "";
foreach ( $files as $file )
{
$timestamp = filemtime($file);
if ( $timestamp > $maxtimestamp )
{
$maxtimestamp = $timestamp;
$maxfilename = $file;
}
}
return date("Ymd",$maxtimestamp)." ($maxfilename)";
}
print "last update: ".get_last_update("./lib/", "./css/", "./lang/");
?>
OUTPUT:
last update: 20110927 (./lang/sk.php)