Ver Mensaje Individual
  #5 (permalink)  
Antiguo 04/11/2014, 14:41
Avatar de hhs
hhs
Colaborador
 
Fecha de Ingreso: junio-2013
Ubicación: México
Mensajes: 2.995
Antigüedad: 10 años, 10 meses
Puntos: 379
Respuesta: Multiplicar array

Puedes hacer algo asi

Código PHP:
Ver original
  1. $entrada=str_split(strrev($entrada));
  2.  
  3. function producto(&$item, $key){
  4.     $item = $key % 2 ? $item * 1 : $item * 2;
  5. }
  6.  
  7. array_walk($entrada, 'producto');
  8.  
  9. $resultado = array_sum($entrada);
__________________
Saludos
About me
Laraveles
A class should have only one reason to change.