I want to output the last 13 months, beginning with last month.
my code:
for($i=1;$i<=(13);$i++)
{
echo date("m",strtotime("-".$i." month"));
}
It worksfine, but today (31.) it looks like this 07 07 05 05 03 03 01 12 12 10 10 08 07
I am missing the months, that do not have 31 days. How can I fix this?