<?php
function mittel()
{
$anz = func_num_args();
$sum = 0;
for ($i=0;$i<$anz;$i++)
{
$sum = $sum + func_get_arg($i);
}
$mit = $sum / $anz;
echo $mit;
}
?>
<?php
include "Mittelwert.inc.php";
mittel(6,3,5,2,5);
function maximum()
{
$num = func_num_args();
echo "Es sind ". "$num"." Variablen.";
$mx = 0;
for ($i=0;$i<$num;$i++);
{
if ($mx < func_get_arg($i))
$mx = func_get_arg($i);
echo $mx;
}
}
echo maximum(1,2,3);
?>
It say as error Warning: func_get_arg(): Argument 3 not passed to function in blablabla.php on line 23()
I want to know how i can use if in for a thing like if its possible or anothrr code as solution for my problem.