Given a time, how can I find the time one month ago.
This code is for getting 1 month before not 30 days
$date = "2016-03-31"; $days = date("t", strtotime($date)); echo date("Y-m-d", strtotime( "-$days days", strtotime($date) ));