Reputation: 19
$date = explode("/",$_POST['datum1']); // format is dd/mm/yyyy then use the below
$date_customer = $date[0];
let suppose i enter 4-1-2011, it will insert only 4 in the database by using insert query but now i want to add one month to it. mean if i enter 4th jan it inserts this, but wat wil be the code for inserting 4th Feb. date, 4th March and so on from the same input that is 4th jan ??
Upvotes: 0
Views: 2588
Reputation: 2085
It'll probably work better like this:
$yourDate = "2012-10-05";
$mydate = date('Y-m-d', strtotime('+1 month', strtotime($yourDate)));
Upvotes: 1