Show sourcecode
The following files exists in this folder. Click to view.
index.php
ovn1_gr.php
ovn2_fn.php
ovn3_inkl.php
ovn3_inklfil.php
ovn3_inklfil2.php
ovn3_inklsida1.php
ovn3_inklsida2.php
ovn3_inklsida3.php
ovn3_inklsidafil.php
ovn4_form.php
ovn4_mottagare.php
ovn4_mottagare2.php
ovn4_mottagare3.php
ovn4_mottagare4.php
quiz.php
ovn1_gr.php
78 lines UTF-8 Windows (CRLF)
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<?php
$farenehit = -40;
$celsius = (5/9)*($farenehit - 32);
echo "1. " . $farenehit . " farenheit = " . $celsius . " celsius";
?>
<br>
<?php
$text1 = "Kalle";
$enamn = "Anka";
$tal = 16;
$road = "Ankvägen";
echo "2. ". $text1 . " " . $enamn . " " . "bor på" . " " . $road . " " . $tal;
?>
<br>
<?php
$total1 = 0;
for ($i1 = 0; $i1 <= 100; $i1++){
$total1 += $i1;
}
$i2 = 0;
$total2 = 0;
while ($i2 <= 100){
$total2 += $i2;
$i2++;
}
echo "3. For-loop: " . $total1 . " While-loop: " . $total2;
?>
<br>
<?php
echo "4. ";
$i = -20;
$array = [];
$farenheit = 0;
echo "Loop: ";
while ($i <= 40){
$farenheit = ($i*1.8)+32;
echo "C: " . $i . ", F: " . $farenheit . " | ";
$array[]="C: " . $i . ", F: " . $farenheit;
$i += 10;
}
echo "Var dump: ";
var_dump ($array);
echo "Printr: ";
print_r ($array);
?>
<br>
<?php
$i = 0;
$array = [];
$total = 0;
$sum = 0;
echo "5. ";
while ($i <= 10){
$total = 2**$i;
$array[]=$total;
$i += 1;
$sum += $total;
echo $total . ", ";
}
var_dump ($array);
echo "Medel värde = " . $sum/($i-1);
?>
?>
</body>
</html>