l207/overzicht.php
<!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
//forloop
//for($i=1;$i <=10; $i++){
// echo "<div>$i</div>";
//}
//function
//if($_GET['a'] && $_GET['b']){
// $a = $_GET['a'];
// $b = $_GET['b'];
// $c = round(schuinezijde($a,$b),2);
// echo "De schuine zijde van een driehoek met rechthoekzijdes $a en $b is $c.";
//}
//function schuinezijde($a, $b){
//return sqrt($a*$a + $b * $b);
//}
foreach($hoofdsteden as $land => $stad){
echo "<div>de hoofdstad van $land is $stad</div>";
}
?>
<form>
a: <input type = 'text' name ='a'>
b: <input type = 'text' name ='b'>
<input type = 'submit' value='bereken'>
</form>
</body>
</html>
Resultaat
Made by Thijs Aarnoudse