Ver Mensaje Individual
  #2 (permalink)  
Antiguo 06/10/2015, 06:19
Avatar de xfxstudios
xfxstudios
 
Fecha de Ingreso: junio-2015
Ubicación: Valencia - Venezuela
Mensajes: 2.448
Antigüedad: 8 años, 10 meses
Puntos: 263
Respuesta: uso de hasnext() en array

prueba esto:

Código PHP:
Ver original
  1. <?php
  2. $ait = new ArrayIterator(array('Value 1', 'Value 2', 'Value 3', 'Value 4'));
  3. $cit = new CachingIterator($ait);
  4.  
  5. foreach ($cit as $value) {
  6.     echo $value;
  7.     //if has a next value, print a comma
  8.     if ($cit->hasNext()) {
  9.         echo ', ';
  10.     }
  11. }
  12. ?>
http://php.net/manual/es/cachingiterator.hasnext.php
__________________
[email protected]
HITCEL