Ver Mensaje Individual
  #2 (permalink)  
Antiguo 22/07/2011, 04:15
Avatar de repara2
repara2
 
Fecha de Ingreso: septiembre-2010
Ubicación: München
Mensajes: 2.445
Antigüedad: 13 años, 7 meses
Puntos: 331
Respuesta: realizar concatenar separando con comas y punto al final

A ver si sirve:

Código PHP:
Ver original
  1. <?php
  2. $array = array("leche", "huevos", "pan", "azucar");
  3.  
  4.     $string = "";
  5.     foreach ($array as $value) {
  6.         $string .= $value.", ";
  7.     }
  8.     //Ahor a quito la coma
  9.     $string = substr($string, 0, -1);
  10.     //Y pongo un punto
  11.     $string .=".";
  12.    
  13.     echo $string;
  14. ?>
__________________
Fere libenter homines, id quod volunt, credunt.