PHP line date + 1 day equals?

I have a date that is stored in a regular line.

// format = DD-MM-YYYY $date = "10-12-2011"; 

how can i get datestring + 1 day like this: 12-12-2011?

Thanks in advance

+6
source share
3 answers

Related posts

 $date = date('dm-Y', strtotime("+1 day", strtotime("10-12-2011"))); 
+25
source

You can use the date function to combine the date together manually (obviously, you need to check for leap years, the number of days in the current month, etc.) or get strtotime and convert what you get through the date function, analyzing the time stamp received by you from strtotime, as the second argument.

0
source

if you want today +$i day

 $today = date('Ym-d'); $tomorrow = strtotime($today." +".$i." day"); 
0
source

Source: https://habr.com/ru/post/903519/


All Articles