Webbserverprogrammering 1

Show sourcecode

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

webbsrvprg/webbsrvprg/exercises/

PHPDB/
class_upg1.php
class_upg2.php
class_upg3.php
class_upg4.php
class_upg5.php
class_upg6.php
class_upg7.php
class_upg8.php
cookie1.php
cookie2.php
cookie3.php
cookie3form.php
form_mottag.php
form_mottag2.php
form_mottag3.php
formulär.php
hemlighet.php
index.css
index.php
own_fn1.php
own_fn2.php
own_fn3.php
own_fn4.php
own_fn5.php
own_fn6.php
own_gr1.php
own_gr2.php
own_gr3.php
own_gr4.php
own_gr5.php
own_gr6.php

own_fn4.php

34 lines UTF-8 Windows (CRLF)
<!DOCTYPE html>
<html lang="sv">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>ovn 4 fn</title>
</head>
<body>
    <?php 
    
function största($tal1, $tal2, $tal3, string $minsta = ""){
        echo 
"Talen är $tal1, $tal2, $tal3<br>";
        if (
$minsta == "minsta") {
            if(
$tal1 <= $tal2 && $tal1 <= $tal3){
                echo 
"$tal1 är minst!<br><br>";}
            elseif(
$tal2 <= $tal1 && $tal2 <= $tal3){
                echo 
"$tal2 är minst!<br><br>";
            } else{
                echo 
"$tal3 är minst!<br><br>";
            }
        }
        elseif (
$tal1 >= $tal2 && $tal1 >= $tal3) {
    echo 
"$tal1 är störst!<br><br>";
} elseif (
$tal2 >= $tal1 && $tal2 >= $tal3) {
    echo 
"$tal2 är störst!<br><br>";
} else {
    echo 
"$tal3 är störst!<br><br>";
}
    }
största(86, 91, 84, "minsta");
största(90, 12, 56,);
största(78, 9, 24, "minsta");
?>
</body>
</html>