? ??????????????Phone Booth? ????? ?? ???Rating: 4.6 (12 Ratings)??103 Grabs Today. 22701 Total Grabs. ???
???Preview?? | ??Get the Code?? ?? ?????Purple Flower? ????? ?? ???Rating: 4.3 (726 Ratings)??62 Grabs Today. 103720 Total Grabs. ??????Preview?? | ??Get the Code?? ?? ???????????? ? BLOGGER TEMPLATES AND TWITTER BACKGROUNDS ?

Senin, 07 September 2009

Aritmatika


Scriptnya:

<?php
$nilai1=32;
$nilai2=8;

$jumlah=$nilai1+$nilai2;
$kurang=$nilai1-$nilai2;
$kali=$nilai1*$nilai2;
$bagi=$nilai1/$nilai2;
$sisa=$nilai1%$nilai2;

print "Contoh operasi Aritmatika <br>";
print "Nilai \$nilai1=$nilai1 dan \$nilai2=$nilai2 <br><br>";
print "\$nilai1 + \$nilai2 = $jumlah <br>";
print "\$nilai1 - \$nilai2 = $kurang <br>";
print "\$nilai1 * \$nilai2 = $kali <:br>"; print "\$nilai1 / \$nilai2 = $bagi <br>"; print "\$nilai1 % \$nilai2 = $sisa <br>"; ?>


For


Scriptnya:

<?php
for ($i = 1; $i <= 5; $i++) { print $i ."<br> "; } $bila = 5; $pola = 1; print " <br> Bilangan ganjil antara 5 sampai 25 <br>";
for ($pola=1; $pola<10; style="font-weight: bold;">Foreach
Scriptnya:
<?php
$klub = array ("Persik Kediri", "Persebaya Surabaya", "PSIS Semarang", "Persipura Jayapura");

print "Klub-klub yang pernah juara Liga Indonesia :<br>";

foreach ($klub as $nilai)
{
print "$nilai <br>";
}
?>

0 komentar: