Can anyone see what I am doing worng?
Code: Select all
<?php
$filename = 'css.css';
if ($timestamp = strtotime("+2 days")) {
echo "Script has not run for 2 days";
} else {
echo "$filename == " . date('l dS \o\f F Y h:i:s A');
}
?> Moderator: General Moderators
Code: Select all
<?php
$filename = 'css.css';
if ($timestamp = strtotime("+2 days")) {
echo "Script has not run for 2 days";
} else {
echo "$filename == " . date('l dS \o\f F Y h:i:s A');
}
?> Code: Select all
$filename = "css.css";
$filetime = filemtime("/path/to/$filename");
if (strtotime("+2 days", $filetime) < time()) {
echo "OLDER THAN 2 DAYS";
} else {
echo "NOT OLDER THAN 2 DAYS";
}Code: Select all
if($filetime * 172800 < time()) {No offence taken, i'm a noob.AbraCadaver wrote:No offense, but I can't see anything that you are doing right. Try this:
You could also use:Code: Select all
$filename = "css.css"; $filetime = filemtime("/path/to/$filename"); if (strtotime("+2 days", $filetime) < time()) { echo "OLDER THAN 2 DAYS"; } else { echo "NOT OLDER THAN 2 DAYS"; }Though you use the phrase "has not run for 2 days", in which case that would be the access time fileatime() instead of the modification time filemtime().Code: Select all
if($filetime * 172800 < time()) {