I'm trying to create a cron job that will provide me with a list of files in a directory that have been created or modified in the last day. For the life of me I can't see what is wrong with the code snippet below. It produces nothing and I know that I've updated at least one file in the last 24 hours.
<?php
$dir = opendir(".");
clearstatcache();
while(false != ($file = readdir($dir)))
{
if ( substr($file,-4) == ".php" )
{
//echo $file;
//echo "<br>";
$yesdate = date('d.m.Y',strtotime("-1 days"));
if (date("d.m.Y", filemtime($file))==$yesdate)
{
echo $file;
}
}
}
?>