I currently have this code.
function outputCalendarByDateRange($client, $startDate="2011-06-22",
$endDate='2011-06-26')
I want $startDate and $endDate to reflect today's date and the date three days from now with it automatically updating. I've tried using
$startDate=date("Y-m-D")
$endDate=strtotime(date("Y-m-d", strtotime($todayDate)) . " +3 days");
and
$date1=date("Y-m-D")
$date2=strtotime(date("Y-m-d", strtotime($todayDate)) . " +3 days");
function outputCalendarByDateRange($client, $startDate=$date1,
$endDate=$date2)
none of these work. How do I make it work?
Thanks!
$endDateis highly overdone. A simple$endDate = date('Y-m-D', strtotime('+3 days'))will do.$endDate = date('Y-m-d', strtotime($startDate . '+3 days'))to handle date changes during execution of the two statements. It will still be off a day by the time the script gets to the third line of code, but at least the two dates will be off uniformly...