Pengenalan PHP
Pengenalan PHP
PART 1
Source Code :
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<style type="text/css">
body{
background-image: url(wp-aes.jpg);
background-size: cover;
background-repeat: no-repeat;
background-position: center;
background-attachment: fixed;
height: 100%;
}
.tgl{
font-family: times new roman;
font-size: 30px;
color: black;
display: flex;
justify-content: center;
}
img{
height: 315px;
width: 315px;
}
h2{
font-family: arial;
color: red;
}
h3{
font-family: arial;
color: white;
}
</style>
</head>
<body>
<?php
echo '<div class = "tgl">'.date("d-M-Y").'</div>';
echo '<br>';
echo '<div class = "tgl"> Di Atas Adalah Tanggal Hari Ini </div>';
?>
<center>
<h2>Wisata Raja Ampat</h2>
<h3>Indonesia Raya</h3>
<img src="https://awsimages.detik.net.id/community/media/visual/2019/02/28/e27d496c-d76b-4415-8cc3-d1131c07215f_169.jpeg?w=1200">
<iframe width="560" height="315" src="https://www.youtube.com/embed/feoRIr5MNHM" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</center>
</body>
</html>
Hasil :
PART 2
Source Code :
<?php
$nama = "Aditya Putra Ramadhan";
$ttl = "Jakarta, 16 Oktober 2004";
$umur = 17;
$alamat = "jalan luar batang 9, penjaringan, jakarta utara";
$hobi = "berolahraga & traveling";
$cita = "programmer & pengusaha";
$sekolah = "SMKN 1 Jakarta";
$kelas = "XII RPL";
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<style type="text/css">
body{
background-image: url(wp-aes.jpg);
background-size: cover;
background-repeat: no-repeat;
background-position: center;
background-attachment: fixed;
height: 100%;
}
table{
background-image: url(kertas.jpg);
font-family: verdana;
margin-top: 100px;
}
</style>
</head>
<body>
<table border="5px" align="center">
<thead>
<th colspan="2">
Biodata Diri
</th>
</thead>
<tbody>
<tr>
<td>Nama :</td>
<td><?php echo $nama; ?></td>
</tr>
<tr>
<td>Tempat Tanggal Lahir :</td>
<td><?php echo $ttl; ?></td>
</tr>
<tr>
<td>Umur :</td>
<td><?php echo $umur; ?></td>
</tr>
<tr>
<td>Alamat :</td>
<td><?php echo $alamat; ?></td>
</tr>
<tr>
<td>Hobi :</td>
<td><?php echo $hobi; ?></td>
</tr>
<tr>
<td>Cita - Cita :</td>
<td><?php echo $cita; ?></td>
</tr>
<tr>
<td>Sekolah :</td>
<td><?php echo $sekolah; ?></td>
</tr>
<tr>
<td>Kelas :</td>
<td><?php echo $kelas; ?></td>
</tr>
</tbody>
</table>
</body>
</html>
Hasil :
PART 3
Source Code :
<?php
$string = "Aditya Putra Ramadhan";
$int = 1610;
$float = 9.5;
$boolean = 16;
$array = ["Nike","Adidas","Puma","Diadora","Under Armour"];
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<style type="text/css">
body{
background-image: url(wp-aes.jpg);
background-size: cover;
background-repeat: no-repeat;
background-position: center;
background-attachment: fixed;
height: 100%;
}
table{
background-image: url(kertas.jpg);
font-family: verdana;
margin-top: 100px;
}
</style>
</head>
<body>
<table border="5px" align="center">
<thead>
<th colspan="2">
Tipe Data
</th>
</thead>
<tbody>
<tr>
<td>String</td>
<td><?php echo $string; ?></td>
</tr>
<tr>
<td>Integer</td>
<td><?php echo $int; ?></td>
</tr>
<tr>
<td>Float</td>
<td><?php echo $float; ?></td>
</tr>
<tr>
<td>Boolean :</td>
<td>
<?php
if ($boolean > 10) {
echo $boolean." bernilai true";
} else {
echo $boolean." bernilai false";
}
?>
</td>
</tr>
<tr>
<td>Array :</td>
<td><?php echo $array[0]; ?></td>
</tr>
</tbody>
</table>
</body>
</html>
Hasil :
.png)
.png)
.png)
Komentar
Posting Komentar