Я бы сделал это так ...
<?php
// current day to start with
$start = mktime(0,0,0,date('m'), date('d'), date('Y'));;
// loop through the current and last four month
for ($i = 0; $i <=4; $i++) {
// calculate the first day of the month
$first = mktime(0,0,0,date('m',$start) - $i,1,date('Y',$start));
// calculate the last day of the month
$last = mktime(0, 0, 0, date('m') -$i + 1, 0, date('Y',$start));
// now some output...
echo date('Y-m-d',$first) . " - ".date('Y-m-d',$last). "<br>";
}
?>