I have a strtotime date in a variable. I need to find out the 4th day from that variable
$strtotime1=strtotime('06/17/2012');
I need to find out the 4th day (i.e. 06/21/2012) in strtotime format.
I have tried with:
$strtotime2=$strtotime1+4*60 * 60;
But it's not working.
You are adding 4 hours not 4 days.
It should be $strtotime2=$strtotime1+4*24*60*60;
Or
You could do like:
$strtotime2 = strtotime('+4 days', $strtotime1);
$date2 = date('m/d/Y', $strtotime2);