Woodburn2006 Posted September 14, 2006 Share Posted September 14, 2006 if i have a variable with a number of days e.g. 20. is there any way of adding that number to a date so that we get a new date.for example if i start with 2006/04/20 i would add 20 to it and end up with 2006/05/10.is there any way of doing this? Link to comment https://forums.phpfreaks.com/topic/20773-dates/ Share on other sites More sharing options...
Barand Posted September 14, 2006 Share Posted September 14, 2006 [code]<?php$date = '2006/04/20';$addDays = 20echo date ('Y/m/d', strtotime ("$date + $addDays days"));?>[/code] Link to comment https://forums.phpfreaks.com/topic/20773-dates/#findComment-91963 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.