Webbserverprogrammering 1

Show sourcecode

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

webbsrvprg/exercises/

hej.php
hej.py
index.php
mysqlintro_1.php
ovn_cookie1.php
ovn_cookie2.php
ovn_cookie3_1.php
ovn_cookie3_2.php
ovn_cookie4.php
ovn_cookie5.php
ovn_cookie6.php
ovn_form1.php
ovn_form2.php
ovn_form3_1.php
ovn_form3_2.php
ovn_form7_1.php
ovn_form7_2.php
ovn_form8_1.php
ovn_form_tillamp1_1.php
ovn_form_tillamp1_2.php
ovn_form_tillamp2.php
ovn_form_tillamp3.php
ovn_form_tillamp4.php
ovn_form_tillamp5.php
ovn_form_tillamp6.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_gr7.php
ovn_incl1/
ovn_incl2/
ovn_incl3/
ovn_klass1.php
ovn_klass2.php
ovn_klass3.php
ovn_klass4.php
ovn_klass5.php
ovn_klass6.php
ovn_klass7.php
ovn_mysqlintro1_1.php
ovn_mysqlintro1_2.php
ovn_str1_1.php
ovn_str1_2.php
ovn_str2_1.php
ovn_str2_2.php
ovn_str3_1.php
ovn_str3_2.php
ovn_str4_1.php
ovn_str4_2.php
ovn_str5_1.php
ovn_str5_2.php
ovn_str6_1.php
ovn_str6_2.php

ovn_funk8.php

60 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
error_reporting
(-1); // Report all type of errors
ini_set('display_errors'1); // Display all errors
ini_set('output_buffering'0); // Do not buffer outputs, write directly

  
$array1 = [25468713522];
  
$medianMedelvärde = [];
  
print_r($array1);

  function 
medianMedelvärde($array1$medianMedelvärde) {
    
sort($array1);
    
$medianMedelvärde[0] = $array1[floor(count($array1)/2)];

    
$total 0;
    for (
$i=0$i count($array1); $i++){
      
$total += $array1[$i];
          
    }
    
$medianMedelvärde[1] = ($total/count($array1));

    return 
$medianMedelvärde;

  }

  
print_r(medianMedelvärde($array1$medianMedelvärde));

  











  function 
medelvärde($array1) {
    
$total 0;
    for (
$i=0$i count($array1); $i++){
      
$total += $array1[$i];
          
    }
    return (
$total/count($array1));

  }

  echo 
"<br>"medelvärde($array1);
  
?>
</body>
</html>