Biodata
Program Biodata Menggunakan PHP
Cara 1
<?php
echo "Biodata Teman<br><br>";
$nama1 = "Aldi";
$nama2 = "Ubai";
$nama3 = "Zaky";
$nama4 = "Andi";
$nama5 = "Bram";
$alamat1 = "Sumatera";
$alamat2 = "Lampung";
$alamat3 = "Magelang";
$alamat4 = "Kalimantan";
$alamat5 = "Kediri";
echo "Nama : ".$nama1."<br>";
echo "Alamat : ".$alamat1."<br><br>";
echo "Nama : ".$nama2."<br>";
echo "Alamat : ".$alamat2."<br><br>";
echo "Nama : ".$nama3."<br>";
echo "Alamat : ".$alamat3."<br><br>";
echo "Nama : ".$nama4."<br>";
echo "Alamat : ".$alamat4."<br><br>";
echo "Nama : ".$nama5."<br>";
echo "Alamat : ".$alamat5."<br>";
?>
Cara 2
<?php
echo "Biodata Teman<br><br>";
$nama[0] = "Aldi";
$nama[1] = "Ubai";
$nama[2] = "Zaky";
$nama[3] = "Andi";
$nama[4] = "Bram";
$alamat[0] = "Sumatera";
$alamat[1] = "Lampung";
$alamat[2] = "Magelang";
$alamat[3] = "Kalimantan";
$alamat[4] = "Kediri";
for ($i=0;$i<=4;$i++){
echo "Nama : ".$nama[$i]. "<br>";
echo "Alamat : ".$alamat[$i]. "<br><br>";
}
?>
Cara 3
<?php
echo "Biodata Teman<br><br>";
$nama = array("Aldi","Ubai","Zaki","Andi","Bram");
$alamat = array("Sumatera","Lampung","Magelang","Kalimantan","Kediri");
for ($i=0;$i<=4;$i++){
echo "Nama : ".$nama[$i]."<br>";
echo "Alamat : ".$alamat[$i]."<br><br>";
}
?>
Output
Langganan:
Posting Komentar
(
Atom
)
Tidak ada komentar :
Posting Komentar