I am trying coding a php script where i want to extract a date field from a database table,store this date compare it with todays. To see if the data. from database has pass
I spend lot of time to compare only dates and i found a solution like this
Always set format like date('Y-m-d')
$dateTo='2016-08-07'; if(date("Y-m-d", strtotime($dateTo)) > date('Y-m-d')){ echo 'yes'; }else{ echo 'no'; }