Ver Mensaje Individual
  #2 (permalink)  
Antiguo 17/04/2009, 09:14
Avatar de By_George
By_George
 
Fecha de Ingreso: abril-2009
Ubicación: localhost
Mensajes: 629
Antigüedad: 15 años, 1 mes
Puntos: 19
Respuesta: Es correcto esto...foreach+array

Cita:
Iniciado por hoberwilly Ver Mensaje
Código php:
Ver original
  1. $tallaD=array('1','2','3','4','5');
  2. $tallaV=array('100','101','102');
  3. foreach($carro as $k => $v){
  4.     $contador++;
  5.   ?>
  6. <tr>
  7.     <td height="35" align="center"><?php echo $v['id'] ?></td>
  8.     <td height="35" align="center"><?php echo $v['producto'] ?></td>
  9.     <td><select name="talla[]">
  10.         <?php
  11.         foreach(if($v['categ']=='D'){ echo $tallaD; }elseif($v['categ']=='V'){ echo $tallaV; }else{ echo $tallaO; } as $val1){
  12.         ?>
  13.         <option value="<?php echo $val1 ?>"><?php echo $val1 ?></option>
  14.         <?php
  15.         }
  16.         ?>
  17.         </select>
  18.     </td>
Pero me sale la pagina en blanco, no entiendo quizas esta mal implementado el codigo dentro del bucle...no logro darlo con la solucion...por favor si me podrian ayudar...gracias.
si le quitas los echo en los ifs