Get an array of months between two dates
$StartDate = @strtotime("Jan 2003");
$StopDate = @strtotime("Apr 2004");
/**
* Gets list of months between two dates
* @param int $start Unix timestamp
* @param int $end Unix timestamp
* @return array
*/
function echoDate( $start, $end ){
$current = $start;
$ret = array();
while( $current<$end ){
$next = @date('Y-M-01', $current) . "+1 month";
$current = @strtotime($next);
$ret[] = $current;
}
return array_reverse($ret);
}
$months = echoDate( $StartDate, $StopDate );