|
2)
{
printf('%s ',$itemarray[0], $itemarray[1]);
echo "\n";
}
}
//the delete functions starts here
$currenttime = time();
$dayoftheweek = date("d", $currenttime);
if($dayoftheweek % 10 == 1)
{
$handle=opendir('./cards');
while (false!=($file = readdir($handle))) {
if ($file != "." && $file != ".." && $file !="index.html") {
$file=substr($file,0,-5);
//delete if the file is older than 60 days (5184000 seconds)
if (($file + 5184000) < $currenttime)
{
$fullpathfilename = "./cards/".$file.".html";
unlink ($fullpathfilename);
}
}
}
closedir($handle);
}
?>
|