Función siguiente() de PHP
Ejemplo
Rebobina al primer elemento, muévete al siguiente elemento y luego devuélvelo con la función actual ():
<?php
$note=<<<XML
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Do not forget me this weekend!</body>
</note>
XML;
$xml = new SimpleXMLIterator($note);
// rewind to the first element
$xml->rewind();
// move to the next element
$xml->next();
//
return current element
var_dump($xml->current());
?>
Definición y uso
La función next() se mueve al siguiente elemento.
Sintaxis
SimpleXMLIterator::next()
Detalles técnicos
Valor devuelto: | Nada |
---|---|
Versión PHP: | 5.0+ |
❮ Referencia PHP SimpleXML