php time

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
shaqa
Forum Commoner
Posts: 62
Joined: Mon Aug 13, 2007 9:11 am

php time

Post by shaqa »

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

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);
}
Last edited by Benjamin on Mon May 18, 2009 10:13 am, edited 1 time in total.
Reason: Changed code type from text to php.
shaqa
Forum Commoner
Posts: 62
Joined: Mon Aug 13, 2007 9:11 am

Re: php time

Post by shaqa »

please some one check this
Post Reply