Show sourcecode
The following files exists in this folder. Click to view.
index.html
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_funk9.php
31 lines ASCII Windows (CRLF)
<!DOCTYPE html>
<html>
<body>
<?php
$array = [3, 1, 3, 2, 5];
function medelv(&$array){
$lenpar = func_num_args();
$len = count($array);
$summa = array_sum($array);
echo $summa/$len, "<br>";
if ($lenpar < 2){
asort($array);
$len = count($array);
if ($len %2 == 0){
$len = $len/2;
echo ($array[$len] + $array[$len +1]) / 2;
}
else{
$len -= 1;
$len /= 2;
echo $array[$len];
}
}
}
medelv($array, 1);
?>
</body>
</html>