php - Add variable number of days to date -


how add variable number of days date in php? i've found examples calculating specific number of days, not variable.

$date = $row["date"]; // i.e 2015-12-13 $days = $row["days"]; // i.e 10 

i want output (in example 2015-12-23) put in variable $futuredate.

thanks!

you can try strtotime() , date() functions

$date = $row['date']; $days = $row['days']; $futuredate = date('y-m-d',strtotime($date) + (24*60*60*$days)); 

Comments

Popular posts from this blog

Capture and play voice with Asterisk ARI -

c++ - Can not find the "fiostream.h" file -

visual studio - Installing Packages through Nuget - "Central Directory corrupt" -