skip to Main Content

PHP date->modify and date_add. Why results of this two functions are the same?

I wrote this function $today=new DateTime(date('Y-m-d')); $tomorrow=new DateTime(); $tomorrow=$today->modify('+1 day'); $interval= new DateInterval('P7D'); $enDt= date_add($today,$interval); var_dump($tomorrow->format('d-m-Y'), $enDt->format('d-m-Y')); and I expected $tomorrow should be different from $enDt, because, in the first case, I increase $today of 1 day, and in the…

VIEW QUESTION
Back To Top
Search