alexa-tracking
Selamat Guest, Agan dapat mencoba tampilan baru KASKUS Masih Kangen Tampilan Sebelumnya
Kategori
Kategori
Home / FORUM / All / Tech / ... / Programmer Forum /
Question mohon bantuannya kk newbie.
1024
1024
KASKUS
51
244
https://www.kaskus.co.id/thread/541b44d7118b46a9538b456a/question-mohon-bantuannya-kk-newbie

Question mohon bantuannya kk newbie.

<?php echo $_REQUEST['n'];

$warna2 = array ("senin","selasa","rabu","kamis","jumat","sabtu","minggu");

foreach($warna2 as $warna) switch($warna){

case $warna2[1] : echo " senin ";
break;
case $warna2[2] : echo " selasa ";
break;
case $warna2[3] : echo " rabu ";
break;
case $warna2[4] : echo " kamis ";
break;
case $warna2[5] : echo " jumat ";
break;
case $warna2[6] : echo " sabtu ";
break;
case $warna2[7] : echo " minggu ";
break;

} ?>

tampilan di mozila http://localhost/tugas/warna.php?n=2 muncul nya 2 senin selasa rabu kamis jumat sabtu

klo n=2 pengen yang muncul cuma selasa doang gmna ya??
yang benernya??
Beri apresiasi terhadap thread ini Gan!
Code:

<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
Input: <input type="text" name="idx">
<input type="submit">
</form>

<?php
$idx = $_REQUEST['idx'];
switch($idx){
case "1":
$hari="Senin";
break;
case "2":
$hari="Selasa";
break;
case "3":
$hari="Rabu";
break;
case "4":
$hari="Kamis";
break;
case "5":
$hari="Jumat";
break;
case "6":
$hari="Sabtu";
break;
case "7":
$hari="Minggu";
break;
default:
$hari="";
break;
}
echo $hari;
?>

bener gak? ane belom coba sih

Diubah oleh oman96

big thank

mksh gan


×
GDP Network
© 2018 KASKUS, PT Darta Media Indonesia. All rights reserved
Ikuti KASKUS di