Webbserverprogrammering 1

Show sourcecode

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

webbsrvprg/exercises/

db-test.php
ovn_form1.php
ovn_form2.php
ovn_form3.php
ovn_form4.php
ovn_form5.php
ovn_form6.php
ovn_form7.php
ovn_form8.php
ovn_fragetavling.php
ovn_funk1.php
ovn_funk2.php
ovn_funk3.php
ovn_funk4.php
ovn_funk5.php
ovn_funk6.php
ovn_gr1.php
ovn_gr2.php
ovn_gr3.php
ovn_gr4.php
ovn_gr5.php
svar/
tarningsduellen.php

ovn_funk3.php

34 lines UTF-8 Unix (LF)
<?php
error_reporting
(-1);
ini_set('display_errors', 1);
ini_set('output_buffering', 0);

function 
storstaAvTre($tal1, $tal2, $tal3)
{
    if (
$tal1 >= $tal2 && $tal1 >= $tal3) {
        return 
$tal1;
    }

    if (
$tal2 >= $tal1 && $tal2 >= $tal3) {
        return 
$tal2;
    }

    return 
$tal3;
}

$storsta = storstaAvTre(17, 42, 9);
?>
<!DOCTYPE html>
<html lang="sv">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Funktionsövning 3</title>
</head>
<body>
    <h1>Funktionsövning 3</h1>
    <p>Det största av 17, 42 och 9 är <?= $storsta ?>.</p>
    <p><a href="index.php">Tillbaka till Mina övningar</a></p>
</body>
</html>