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

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -