Ver Mensaje Individual
  #12 (permalink)  
Antiguo 20/08/2014, 01:35
Avatar de Eleazan
Eleazan
 
Fecha de Ingreso: abril-2008
Ubicación: Ibiza
Mensajes: 1.879
Antigüedad: 18 años, 6 meses
Puntos: 326
Respuesta: Duda sobre llamar a funciones

Fíjate en la sentencia "return" de la función. ¿Pq está ahí? ;)

Edit: Te pongo un ejemplo básico
Código PHP:

function suma($a, $b) {
    
$suma = $a + $b;    
    return 
$suma;
}

$valor1=5;
$valor2=3;

$total_suma = suma($valor1, $valor2);
echo 
$total_suma; 
Salvando unas pequeñiiiiitas diferencias, es lo mismo ;)
__________________
>> Eleazan's Source
>> @Eleazan