Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php get looping month

<?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);
}
 
PREVIOUS NEXT
Tagged: #php #looping #month
ADD COMMENT
Topic
Name
9+2 =