Fonction PHP next()
Exemple
Rembobinez jusqu'au premier élément, passez à l'élément suivant, puis renvoyez-le avec la fonction 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());
?>
Définition et utilisation
La fonction next() passe à l'élément suivant.
Syntaxe
SimpleXMLIterator::next()
Détails techniques
Valeur de retour : | Rien |
---|---|
Version PHP : | 5.0+ |
❮ Référence PHP SimpleXML