Show sourcecode
The following files exists in this folder. Click to view.
övning1.php
övning2.php
övning3.php
övning4.php
övning5.php
övningar.php
övningfunk1.php
övningfunk2.php
övningfunk3.php
övningfunk4.php
övningfunk5.php
övningfunk6.php
övningtest.php
övning5.php
30 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 += $tal;
$tal *= 2;
}
$medel = $summa / 10;
echo "Medelvärdet är: $medel. <br>";
echo $box[9];
?>
</body>
</html>