Skip to content

Instantly share code, notes, and snippets.

@luberius
Last active May 31, 2020 17:15
Show Gist options
  • Save luberius/b0d651a7afec55e96d6802e53a01fe05 to your computer and use it in GitHub Desktop.
Save luberius/b0d651a7afec55e96d6802e53a01fe05 to your computer and use it in GitHub Desktop.
Function untuk mengambil nama bulan dalam bahasa indonesia
<?php
function getMonthName($month) {
switch ($month) {
case 1:
$month = 'Januari';
break;
case 2:
$month = 'Februari';
break;
case 3:
$month = 'Maret';
break;
case 4:
$month = 'April';
break;
case 5:
$month = 'Mei';
break;
case 6:
$month = 'Juni';
break;
case 7:
$month = 'Juli';
break;
case 8:
$month = 'Agustus';
break;
case 9:
$month = 'September';
break;
case 10:
$month = 'Oktober';
break;
case 11:
$month = 'November';
break;
case 12:
$month = 'Desember';
break;
default:
$month = 'Invalid';
}
return $month;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment