PHP next() Funzione
Esempio
Riavvolgi al primo elemento, passa all'elemento successivo e poi restituiscilo con la funzione current():
<?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());
?>
Definizione e utilizzo
La funzione next() si sposta all'elemento successivo.
Sintassi
SimpleXMLIterator::next()
Dettagli tecnici
Valore di ritorno: | Niente |
---|---|
Versione PHP: | 5.0+ |
❮ Riferimento PHP SimpleXML