Webbserverprogrammering 1

Show sourcecode

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

webbsrvprg/exercises/

InlämningsFormulär.php
include1.php
include2.php
includesid1.php
includesid2.php
includesid3.php
phpformulär1.php
phpformulär2.php
phpslump6.php
sidslut.php
sidstart.php
test.php
övning1.php
övning2.php
övning3.php
övning4.php
övning5.php
övningfunk1.php
övningfunk2.php
övningfunk3.php
övningfunk4.php
övningfunk5.php
övningfunk6.php
övningtest.php

övningfunk4.php

44 lines UTF-8 Windows (CRLF)
<!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 
$tal1 
= 3; 
$tal2 = 5; 
$tal3 = 8; 

function 
störstaTal(&$tal1, &$tal2, &$tal3, $minMax = "största") { 

    if(
$minMax == "minsta") { 
        if (
$tal1 < $tal2 && $tal1 < $tal3) 
            return 
$tal1; 

        if (
$tal2 < $tal1 && $tal2 < $tal3) 
            return 
$tal2; 

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

        if (
$tal2 > $tal1 && $tal2 > $tal3) 
            return 
$tal2; 

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

echo 
störstaTal($tal1, $tal2, $tal3);

?>


</body>
</html>