php time
Posted: Mon May 18, 2009 9:01 am
i have this code below, i have setup a script which click every 24 and save ip to mysql for ip time checking,
but im not understanding if this is correct one, if this line : intval(($today-$last)/86400)+1; is for 24h !
please someone check it and if is wrong correct for me
but im not understanding if this is correct one, if this line : intval(($today-$last)/86400)+1; is for 24h !
please someone check it and if is wrong correct for me
Code: Select all
function checkLastclick($lastclicked){
$needclicking = 0;
$last = strtotime($lastclicked);
$today = strtotime("now");
$numdays=intval(($today-$last)/86400)+1;
if($numdays>=2){
$needclicking = 1;
}
return ($needclicking);
}