How to revise this php function?

  • Thread starter Thread starter Tony Y
  • Start date Start date
T

Tony Y

Guest
function num($m, $n) {
$addtotal = $m + $n;
$subtotal = $m - $n;
$divtotal = $m / $n;
$multotal = $m * $n;

return $addtotal;
return $subtotal;
return $divtotal;
return $multotal;
}
$resulttwo = function num(10, 4);
echo "result is $resulttwo";

what is worry with the above function? If the returns of the funciton need to be assigned to an array, how should I revise it?
 
Back
Top