Webbserverprogrammering 1

Show sourcecode

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

webbsrvprg/exercises/

cookies.php
formular.php
fragetest3.php
funktioner.php
grunder.php
include/
klasser.php
ovn_cookies1.php
ovn_cookies2.php
ovn_form1.php
ovn_form2.php
ovn_form3.php
ovn_form4.php
ovn_form6.php
ovn_funk1.php
ovn_funk2.php
ovn_funk3.php
ovn_funk4.php
ovn_funk5.php
ovn_grn1.php
ovn_grn2.php
ovn_grn3a.php
ovn_grn3b.php
ovn_include1.php
ovn_klasser1.php
ovn_string1.php
ovn_string2.php
ovn_string3.php
ovn_stringsvar1.php
ovn_stringsvar2.php
ovn_stringsvar3.php
sida1.php
string.php

ovn_funk4.php

35 lines UTF-8 Windows (CRLF)
<!DOCTYPE html>
<html>
<body>

<?php
$tal1 
123;
$tal2 321;
$tal3 212;
$size "störst";

function 
biggest($tal1$tal2$tal3$size) {
    if (
$size == "störst") {
        if (
$tal1 >= $tal2 && $tal1 >= $tal3) {
            return 
$tal1;
        } elseif (
$tal2 >= $tal1 && $tal2 >= $tal3) {
            return 
$tal2;
        } else {
            return 
$tal3;
        }
    } elseif (
$size == "minst") {
        if (
$tal1 <= $tal2 && $tal1 <= $tal3) {
            return 
$tal1;
        } elseif (
$tal2 <= $tal1 && $tal2 <= $tal3) {
            return 
$tal2;
        } else {
            return 
$tal3;
        }
    }
}

echo 
biggest($tal1$tal2$tal3$size);
?>

</body>
</html>