- date: documentation ( source)
- strtotime: documentation ( source)
<?php
$date = new DateTime(date('ymd', strtotime('1st day of last month')));
$i = new DateInterval('P1M');
$end = new DateTime('-1 year');
while ($date >= $end) {
echo $date->format('Y F') . PHP_EOL;
$date = $date->sub($i);
}