array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'tr', ), 'this' => array ( 0 => 'simplexmlelement.rewind.php', 1 => 'SimpleXMLElement::rewind', 2 => 'Rewind to the first element', ), 'up' => array ( 0 => 'class.simplexmlelement.php', 1 => 'SimpleXMLElement', ), 'prev' => array ( 0 => 'simplexmlelement.registerxpathnamespace.php', 1 => 'SimpleXMLElement::registerXPathNamespace', ), 'next' => array ( 0 => 'simplexmlelement.savexml.php', 1 => 'SimpleXMLElement::saveXML', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/simplexml/simplexmlelement/rewind.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

SimpleXMLElement::rewind

(PHP 8)

SimpleXMLElement::rewindRewind to the first element

Açıklama

public SimpleXMLElement::rewind(): void
Uyarı

Prior to PHP 8.0, SimpleXMLElement::rewind() was only declared on the subclass SimpleXMLIterator.

This method rewinds the SimpleXMLElement to the first element.

Bağımsız Değişkenler

Bu işlevin bağımsız değişkeni yoktur.

Dönen Değerler

Hiçbir değer dönmez.

Örnekler

Örnek 1 Rewind to the first element

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

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

Yukarıdaki örneğin çıktısı:

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