Reputation: 343
I'm saving the time to a variable called $time, using $time = time()
, and later on, I need to be able to check to see if the current time is greater than 1 minute by comparing the current time with the previously-saved time.
How can I do this in PHP?
Upvotes: 0
Views: 334
Reputation: 3308
You can save the time to database or session, but this is how you would check
$time = time();
if((time() - $time) > 60){
echo 'past 1 minute';
}
Upvotes: 2