How to increase a date by one month in PHP

2 Answers

0 votes
$dt = strtotime("2020-06-11");
$new_dt = date("Y-m-d", strtotime("+1 month", $dt));

echo $new_dt;
   
   

/*
run:

2020-07-11

*/

 



answered Jun 11, 2020 by avibootz
0 votes
$new_dt = strtotime("+1 month", strtotime("2020-06-11"));

echo date('Y-m-d', $new_dt); ;

   
   

/*
run:

2020-07-11

*/

 



answered Jun 11, 2020 by avibootz

Related questions

...