I have the following code:
public static function getLogFiles()
{
$dir = '../tmp/logs';
$files = scandir($dir);
foreach ($files as $filename){
echo "$filename wurde zuletzt modifiziert:: " . date ("F d Y H:i:s.", filemtime($filename)) . "<br>";
}
die();
}
For debug I used
print_r($files);
and get an array with all files. But I only get the first two modifieddates:
. wurde zuletzt modifiziert:: January 14 2013 09:06:05.
.. wurde zuletzt modifiziert:: December 14 2012 10:46:34.
Warning (2): filemtime(): stat failed for Fleetster.log [APP\Lib\Log4All.php, line 134]
system.log wurde zuletzt modifiziert:: January 01 1970 01:00:00.
Warning (2): filemtime() [function.filemtime]: stat failed for debug.log [APP\Lib\Log4All.php, line 134]
debug.log wurde zuletzt modifiziert:: January 01 1970 01:00:00.
Warning (2): filemtime() [function.filemtime]: stat failed for error.log [APP\Lib\Log4All.php, line 134]
error.log wurde zuletzt modifiziert:: January 01 1970 01:00:00.
What is wrong?
Thank you and best regards