i am a newbie of php, supposed my blog created on 2011 year 1 month.and the article stored time as this 1305357473
. now i want to use a function, which can output the before year and moth as this.
2011 year 1 month
2011 year 2 month
2011 year 3 month
2011 year 4 month
2011 year 5 month
......
i want to make the function can output the current and the past year and month. this is my function and output the result. but i don't know how to finish.
function outYearMonth($year,$month){
$year=date(Y);
$past_month=strtotime(date(1)) ;
$month=strtotime(date(m));
$jg_month=round($month - $past_month);
$month=array();
for($i==0;$i<=$jg_month;$i++){
$month[]= date(1)+1;
}
}