Monday, 12 August 2013

PHP see if a 'last sent' date was 30+ days ago

PHP see if a 'last sent' date was 30+ days ago

I have this PHP Code:
$last_sent=strtotime('2013-08-12');
if($last_sent < strtotime('now +30 days'))
{
echo 'send survey';
}
else
{
echo 'dont send survey';
}
i need to see if the $last_sent date is 30 days ago or more than 30 days
ago. this doesnt seem to be working though.
i i change the last sent date to 2013-07-12 (exactly 30 days ago) it
echoes send survey and then when i change the date to today (2013-08-12)
it still says 'send survey'

No comments:

Post a Comment