Thanks for the replies. I'm trying the code feyd posted right now, as I don't have time to go through the link Draco_03 sent. Thanks by the way.
Back to the code. I tried the code as follows:
Code: Select all
$today = explode('-',date('m-d-y'));
$today = mktime(0,0,0,$todayї1],$todayї2],$todayї0]);
$val = "08-31-04";
$then = explode('-',$val);
$then = mktime(0,0,0,$thenї1],$thenї2],$thenї0]);
$datediff = $today - $then;
if($date <= 345600){ //equal to 4 days; is that right?
echo " NEW<br>\n";
}else{
echo "<br>\n";
}
This code returns the following:
1231056000 09-01-04
1278226800 08-31-04
1270368000 08-28-04
1267689600 08-27-04
1259913600 08-24-04
Why is 09-01-04 less than the August dates? And how do I check that 4 days have passed (60sec x 60 min x 24hr x 4days=345600?)?