SimpleXMLIterator::rewind

(PHP 5, PHP 7)

SimpleXMLIterator::rewindRewind to the first element

说锟斤拷

public SimpleXMLIterator::rewind ( void ) : void

This method rewinds the SimpleXMLIterator to the first element.

锟斤拷锟斤拷

锟剿猴拷锟斤拷没锟叫诧拷锟斤拷锟斤拷

锟斤拷锟斤拷值

没锟叫凤拷锟斤拷值锟斤拷

锟斤拷锟斤拷

Example #1 Rewind to the first element

<?php
$xmlIterator 
= new SimpleXMLIterator('<books><book>PHP Basics</book><book>XML Basics</book></books>');
$xmlIterator->rewind();

var_dump($xmlIterator->current());
?>

锟斤拷锟斤拷锟斤拷锟教伙拷锟斤拷锟斤拷锟�

object(SimpleXMLIterator)#2 (1) {
  [0]=>
  string(10) "PHP Basics"
}