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


i have 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 see if $last_sent date 30 days ago or more 30 days ago. doesnt seem working though.

i change last sent date 2013-07-12 (exactly 30 days ago) echoes send survey , when change date today (2013-08-12) still says 'send survey'

instead of strtotime('now +30 days') use strtotime('-30 days').


Comments

Popular posts from this blog

vb.net - Alternative to the T-SQL AS keyword -

php - MySQLi binding parameters in a prepared statement doesn't work unless inserted after "WHERE" -

ios - CFRelease causing crash in iPad application -