Tugas Mata Kuliah

Contoh penggunaan swicthcse pada php

<?php
$bulan = date(“M”);
switch($bulan)
{
case “Jan” : $namaBulan = “Januari”;
break;
case “Feb” : $namaBulan = “Pebruari”;
break;
case “Mar” : $namaBulan = “Maret”;
break;
case “Apr” : $namaBulan = “April”;
break;
case “May” : $namaBulan = “Mei”;
break;
case “Jun” : $namaBulan = “Juni”;
break;
case “Jul” : $namaBulan = “Juli”;
break;
case “Aug” : $namaBulan = “Agustus”;
break;
case “Sep” : $namaBulan = “September”;
break;
case “Oct” : $namaBulan = “Oktober”;
break;
case “Nov” : $namaBulan = “Nopember”;
break;
case “Dec” : $namaBulan = “Desember”;
break;
}
echo “Nama Bulan Sekarang adalah : “.$namaBulan;
?>

Tinggalkan komentar

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s