Fonction PHP rewind()
Exemple
Rembobinez jusqu'au premier élément puis renvoyez-le (avec 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();
// return current element
var_dump($xml->current());
?>
Définition et utilisation
La fonction rewind() rembobine jusqu'au premier élément.
Syntaxe
SimpleXMLIterator::rewind()
Détails techniques
Valeur de retour : | Rien |
---|---|
Version PHP : | 5.0+ |
❮ Référence PHP SimpleXML