Last active
May 31, 2020 17:15
-
-
Save luberius/b0d651a7afec55e96d6802e53a01fe05 to your computer and use it in GitHub Desktop.
Function untuk mengambil nama bulan dalam bahasa indonesia
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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