Hackerss.com

hackerss
hackerss

Posted on

Sumar 2 numeros in Php

Sumar 2 numeros - Php:


function sumar($a, $b) {
  $total = 0;
  // sum a plus b
  $total = $a+$b;
  // return the sum 
  return $total;
}

//example
$result = sumar(1, 2);

//output
echo $result; //3


Enter fullscreen mode Exit fullscreen mode

Top comments (0)