Ekspresi | Belajar HTML dan PHP | Sunda | Kontak | Gmail | Uang Adsense
Kuliah Sistem Informasi,
PMB Online STMIK Jabar 2020
STMIK JABAR
LP3I Tasikmalaya
STAI Al-Falah
Belajar Pemrograman PHP, MySQL, Framework CI, Domain, Hosting dan CMS Wordpress
Inkubator | Daftar Isi | Bisnis Bitcoin | Tools Penting | PrivacyPolicy | Inggris Arab

Monday, October 5, 2020

DDP 4

ddp4a.php
<html>
<body>
<?php
$x=4;
switch ($x)
{
case 1:
echo "Nomor 1";
break;
case 2:
echo "Nomor 2";
break;
case 3:
echo "Nomor 3";
break;
default:
echo "Angka yang dimasukkan bukan 1, 2 ataupun  3";
}
?>
</body>
</html>

**
ddp4b.php
<html>
<body>
<?php
for ($i=3; $i<=10; $i++)
{
echo "Bilangan ke-$i: " . $i . "<br />";
}
?>
</body>
</html>

**
ddp4c.php
<html>
<body>
<?php
for ($i=1;; $i++)
{
echo "Angkanya adalah " . $i . "<br />";
if ($i>=5) exit;
}
?>
</body>
</html>

**
ddp4e.php
<html>
<body>
<?php
$x=array("satu","dua","tiga");
foreach ($x as $value)
{
echo $value . "<br />";
}
?>
</body>
</html>

**
ddp4f.php
<html>
<body>
<?php
$i=1;
while($i<=9)
{
echo "Bilangan ke-$i: " . $i . "<br />";
$i++;
}
//halaman 27
?>
</body>
</html>

**
ddp4g.php
<html>
<body>
<?php
$i=1;
do
{
$i++;
echo "Bilangan ke-$i: " . $i . "<br />";
}
while ($i<=5);
?>
</body>

</html> 


"Bitcoin and Forex are high risk business. We must join them smartly."
Belajar Bahasa Inggris dan Arab di WA dan FB Gratis!

No comments:

Post a Comment