Karem
Karem

Reputation: 18103

PHP: time>time()

I have:

$lastActivationDelay = time() + 8;
if($lastActivationDelay<$last_activation)

right now, not working properly.

What i want to do is if you try to enter the page, and
if $last_activation is under the $lastactivationdelay time, then echo false, else true.

So if eight seconds from now is over $last_activation, then true, if its under, then false.

Upvotes: 0

Views: 241

Answers (2)

Darryl E. Clarke
Darryl E. Clarke

Reputation: 7637

Assuming $last_activation exists in the past, your comparison is backwards.

if ($lastActivationDelay > $last_activation) { echo 'too soon'; }

Upvotes: 2

methodin
methodin

Reputation: 6712

Are you trying to do:

if($last_activation+8 < time())

Upvotes: 1

Related Questions