<?php
date_default_timezone_set("asia/jakarta");
$jumlahMonth = 12;
$currentMonth = strtotime(date("Y-m-01"));
for ($i = $jumlahMonth-1; $i >= 0; $i--){
$x = date("Y-m-01", $currentMonth);
$monthName = date("F Y", strtotime($x));
echo $monthName;
echo "<br>";
$currentMonth = strtotime('-1 month', $currentMonth);
}