x113/B2.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
$dag = 4;
$uur = 2;
$min = 40;
$sec = 120;
$antwoord = omreken($dag, $uur, $min, $sec);
echo"$dag dagen + $uur uren + $min minuten + $sec seconden is gelijk aan $antwoord sec";
function omreken($dag, $uur, $min, $sec){
$d = $dag * 24 * 60 * 60;
$u = $uur * 60 * 60;
$m = $min * 60;
$tot = $d + $u + $m + $sec;
return $tot;
}
?>
</body>
</html>
Resultaat
Made by Thijs Aarnoudse