Getting last modification date of files in directory using PHP
date("F d Y H:i:s.", false)
is what you are getting. see documentation of filemtime
. It returns false on failure.
Check if the $file var is actually pointing to a correct file
foreach($dir as $file)
{
if(is_file($file))
{
$mod_date=date("F d Y H:i:s.", filemtime($file));
echo "<br>$file last modified on ". $mod_date;
}
else
{
echo "<br>$file is not a correct file";
}
}