Get last 7 days modified files php
$filename = "filename.php";
$aweekago = date('Y-m-d',strtotime('-7 days')); // here you can give your own days
$today = date('Y-m-d');
if (file_exists($filename)) {
if($aweekago < date ("Y-m-d", filemtime($filename))){
echo " [ ".date ("F d Y H:i:s.", filemtime($filename))." ]";
}
}
No comments:
Post a Comment