Ver Mensaje Individual
  #10 (permalink)  
Antiguo 04/03/2013, 12:56
tumbero_x
 
Fecha de Ingreso: octubre-2010
Ubicación: Buenos Aires
Mensajes: 557
Antigüedad: 13 años, 6 meses
Puntos: 4
Respuesta: Modificar un array

de esta forma
Código PHP:
Ver original
  1. $cantidad=array('0','2','0','10','8');
  2. $presu_bundle=array('0','1','0','1','0');
  3. $id=array('49','49','49','60','60','60');
  4. $cantibun=array();
  5. foreach($id as $ide)
  6. {
  7. foreach($presu_bundle as $h=>$bun)
  8.             {
  9.                 $cantibun[]=$cantidad[$h];         
  10.             }
  11. }
$cantibun imprime esto
Código PHP:
Ver original
  1. Array ( [0] => 0 [1] => 2 [2] => 0 [3] => 10 [4] => 8 [5] => 0 [6] => 2 [7] => 0 [8] => 10 [9] => 8 [10] => 0 [11] => 2 [12] => 0 [13] => 10 [14] => 8 [15] => 0 [16] => 2 [17] => 0 [18] => 10 [19] => 8 [20] => 0 [21] => 2 [22] => 0 [23] => 10 [24] => 8 [25] => 0 [26] => 2 [27] => 0 [28] => 10 [29] => 8 )