Hey,
I have an app that generates an array of 27 days from any given day at the start, to display a gannt chart of 4 weeks in advance. BUT as of today (31 August 2009), September goes missing! It jumps straight to 01 OCt, 02 Oct, and so on.
Here's the code ($days is the array):
for($i=0; $i<=27; $i++) {
$last_day = date('d',mktime(date('h'), date('i'), date('s'), date('m'), date('d',mktime(date('H'),date('i'),date('s'),$this_month,$this_day+$i,$this_year)), date('Y')));
$days[] = $last_day;
$last_month = date('m',mktime(date('h'), date('i'), date('s'), date('m',mktime(date('H'),date('i'),date('s'),$this_month,$this_day+$i,$this_year)), date('j'), date('Y')));
$last_year = date('Y',mktime(date('h'), date('i'), date('s'), date('m'), date('d'), date('Y',mktime(date('H'),date('i'),date('s'),$this_month,$this_day+$i,$this_year))));
}
As you can see, it uses mktime to add an increasing ($i) no. of days to the $last_month variable. BUT it jumps straight from 31/08/09 to 01/10/09.
Help! Any ideas?
Thanks heaps.