<?php $a = "2007-01-01"; $b = "2008-02-15"; $i = date("y-m", strtotime($a)); $y = date("y-m", strtotime($b)); while($i <= date("y-m", strtotime($b))){ echo $i."\n"; if(substr($i, 3, 2) == "12") $i = (date('y', mktime(0,0,0,1,1,substr($i,0,2)))+1)."-01"; else $i++; } echo date('y', mktime(0,0,0,1,1,substr($i,0,2)))+1; // echo "Oct 3,1975 was on a ".date("y", mktime(0,0,0,10,3,7)) . "<br>";
You have javascript disabled. You will not be able to edit any code.