Adattandola così sono riuscito a fargli fare quello che mi serviva, magari servirà a qualcuno
Codice PHP:
<?php
$fp = fopen('time.txt', 'w');
// Only take into account those files whose extensions you want to show.
$allowedExtensions = array(
'deb',
'htm',
'html',
'php',
'sh',
'zip',
'rar',
'jpg',
'js'
);
function filemtime_r($path)
{
global $allowedExtensions;
if (!file_exists($path))
return 0;
$extension = end(explode(".", $path));
if (is_file($path) && in_array($extension, $allowedExtensions))
return filemtime($path);
$ret = 0;
foreach (glob($path."/*") as $fn)
{
if (filemtime_r($fn) > $ret)
$ret = filemtime_r($fn);
// This will return a timestamp, you will have to use date().
}
return $ret;
}
$mostra = filemtime_r("/path/to/");
$scrivi = date('j M y', $mostra);
fwrite($fp, $scrivi);
fclose($fp);
?>