How can I compare two dates in PHP?
The date is stored in the database in the following format
2011-10-2
If I wanted to
I had that problem too and I solve it by:
$today = date("Ymd"); $expire = str_replace('-', '', $row->expireDate); //from db if(($today - $expire) > $NUMBER_OF_DAYS) { //do something; }