Webbserverprogrammering 1

Show sourcecode

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

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_funk8.php

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

<?php
function bubbleSort($x)
{
  
  return 
$x;
}

function 
myFunction(...$x){
    
$len=count($x);
    
sort($x);
    
$median=round($len/2);
    echo 
$x[$median];  
    echo 
"<br>";
    
$tot=0;
    for(
$i 0$i $len$i++) {
        
$tot += $x[$i];
    }
    
$med=$tot/$len;
    echo 
$med;
    


}


myFunction(1,3,2,4,5,6,7,7,7,7,7,11,1,2,2,2,3,9,9,9,0,55,421,124,5,55)
?> 

</body>
</html>