is115-php/modul1/index1_5.php

28 lines
646 B
PHP
Raw Normal View History

<?php include '../common.php'; ?><!DOCTYPE html>
2021-08-23 10:41:53 +02:00
<html lang="no">
<head>
<title><?=title();?></title>
<link rel="stylesheet" href="../index.css">
2021-08-23 10:41:53 +02:00
</head>
<body>
<div class="container">
<h1><?=title();?></h1>
<h4><?=getNavigation();?></h4>
<h2>Liten kalkulator</h2>
<div>
<?php
$input = $_GET['s'] ?? 4400;
$timer = floor($input / 3600);
2021-08-25 09:04:32 +02:00
$minutter = floor(($input - 3600 * $timer) / 60);
$sekunder = $input % 60;
2021-08-23 10:41:53 +02:00
?>
2021-08-25 09:04:32 +02:00
<p><?=$input;?> sekunder blir <?=floor($timer);?> timer <?=$minutter;?> minutter og <?=$sekunder;?> sekunder</p>
2021-08-23 10:41:53 +02:00
</div>
</div>
</body>
</html>