I have a number and I want to increase the month of date so if the date is 2016-01-01
will return 2016-04-01
$month = 3;
$date = date('Y-m-d', strtotime(str_replace('/', '-', $this->input->post('date'))));
I have a number and I want to increase the month of date so if the date is 2016-01-01
will return 2016-04-01
$month = 3;
$date = date('Y-m-d', strtotime(str_replace('/', '-', $this->input->post('date'))));
Untested, But you could do something like:
$month = 3;
$newdate = date('Y-m-d', strtotime("+".$month." months", str_replace('/', '-', $this->input->post('date'))));
You can add three months in a given date by using this:
$Date = date('Y-m-d', strtotime("+3 months", strtotime(str_replace('/','-', $this->input->post('date') ))));