(PHP 5 >= 5.1.0, PHP 7)
Rewind to the first element
public void SimpleXMLIterator::rewind ( void )
This method rewinds the SimpleXMLIterator to the first element.
Returns:
No value is returned.
Examples:
Rewind to the first element
1 2 3 4 5 6 | <?php $xmlIterator = new SimpleXMLIterator( '<books><book>PHP Basics</book><book>XML Basics</book></books>' ); $xmlIterator -> rewind (); var_dump( $xmlIterator ->current()); ?> |
The above example will output:
object(SimpleXMLIterator)#2 (1) { [0]=> string(10) "PHP Basics" }
Please login to continue.