Ver Mensaje Individual
  #2 (permalink)  
Antiguo 09/01/2007, 12:18
Avatar de Nefertiter
Nefertiter
 
Fecha de Ingreso: enero-2003
Ubicación: Rosario
Mensajes: 1.316
Antigüedad: 23 años, 10 meses
Puntos: 9
Re: Operaciones matematicas entre variables

Código PHP:
function suma ($a, $b){ return $a + $b}
function 
resta ($a, $b){ return $a - $b}

if (
$simbolo == '+') $funcion = 'suma';
if (
$simbolo == '-') $funcion = 'resta';

$resultado = $funcion($a,$b);