Webbserverprogrammering 1

Show sourcecode

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

webbsrvprg/webbsrvprg/ovningar/

ovn_form1.php
ovn_form1a.php
ovn_form2.php
ovn_form2a.php
ovn_form3.php
ovn_form3a.php
ovn_form4.php
ovn_form4a.php
ovn_form5.php
ovn_form5a.php
ovn_form6.php
ovn_form6a.php
ovn_form7.php
ovn_form7a.php
ovn_funk1.php
ovn_funk2.php
ovn_funk3.php
ovn_funk4.php
ovn_funk5.php
ovn_funk6.php
ovn_funk7.php
ovn_funk8.php
ovn_funk9.php
ovn_gr1.php
ovn_gr2.php
ovn_gr3.php
ovn_gr4.php
ovn_gr5.php
ovn_gr6.php

ovn_funk4.php

45 lines ASCII Windows (CRLF)
<!DOCTYPE html>
<html>
<body>

<?php
function myFunction($num1$num2$num3$type="big"){
    if(
$type=="big"){
        if(
$num1>$num2){
            
$big=$num1;
        }
        else{
            
$big=$num2;
        }
        if(
$big>$num3){
            
$big=$big;
        }
        else{
            
$big=$num3;
        }
    }
    else if(
$type=="small"){
        if(
$num1>$num2){
            
$big=$num2;
        }
        else{
            
$big=$num1;
        }
        if(
$big>$num3){
            
$big=$num3;
        }
        else{
            
$big=$big;
        }
    }
    echo 
$big;
}
$antal1=2;
$antal2=3;
$antal3=4;
$t="small";
myFunction($antal1$antal2$antal3$t)
?> 

</body>
</html>