Webbserverprogrammering 1

Show sourcecode

The following files exists in this folder. Click to view.

webbserverprogramering/exercises/

phpstartsida.php
uppgiftForm_1.php
uppgiftFunk_1.php
uppgiftFunk_2.php
uppgiftFunk_3.php
uppgiftFunk_4.php
uppgiftFunk_5.php
uppgiftFunk_6.php
uppgiftIncl_1.php
uppgiftIncl_1_incl.php
uppgiftIncl_2_1.php
uppgiftIncl_2_2.php
uppgiftIncl_2_3.php
uppgiftIncl_2_slut.php
uppgiftIncl_2_start.php
uppgiftIncl_2_tal.php
uppgiftQuiz.php
uppgiftString_1.php
uppgiftString_2.php
uppgiftString_3.php
uppgiftString_4.php
uppgiftString_5.php
uppgift_1.php
uppgift_2.php
uppgift_3.php
uppgift_4.php
uppgift_5.php

uppgift_5.php

36 lines UTF-8 Windows (CRLF)
<!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
$box 
= [];
$tal = 1;
$summa = 0;

for (
$i = 0; $i < 10; $i++) {
    
$box[$i] = $tal;
    
$summa = $summa + $tal;
    
$tal= $tal * 2;
}

$medel = $summa / 10;

echo 
"Medelvärdet är: $medel <br>";
echo 
$box[0],"<br>";
echo 
$box[1],"<br>";
echo 
$box[2],"<br>";
echo 
$box[3],"<br>";
echo 
$box[4],"<br>";
echo 
$box[5],"<br>";
echo 
$box[6],"<br>";
echo 
$box[7],"<br>";
echo 
$box[8],"<br>";
echo 
$box[9],"<br>";
?>

</body>
</html>