Ver Mensaje Individual
  #11 (permalink)  
Antiguo 04/03/2009, 15:37
Avatar de foreverOdd
foreverOdd
 
Fecha de Ingreso: noviembre-2007
Ubicación: Caracas
Mensajes: 489
Antigüedad: 16 años, 5 meses
Puntos: 14
Respuesta: Quitar una coma al final de un loop

Una manera mas elegante de hacerlo puede ser:

Código php:
Ver original
  1. foreach( $el_loop as $numero=>$mi_loop ) {
  2. $con_o_sin_coma = (end($el_loop)==$mi_loop) ? ")" : "),";
  3.   /* Código */
  4. }

Saludos
__________________
My path is lit by my own fire, I only go where I desire