PHP Doku:: Move to next element - simplexmliterator.next.html

Verlauf / Chronik / History: (5) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzSonstige GrunderweiterungenStandard PHP Library (SPL)IteratorenThe SimpleXMLIterator classSimpleXMLIterator::next

Ein Service von Reinhard Neidl - Webprogrammierung.

The SimpleXMLIterator class

<<SimpleXMLIterator::key

SimpleXMLIterator::rewind>>

SimpleXMLIterator::next

(PHP 5 >= 5.1.0)

SimpleXMLIterator::nextMove to next element

Beschreibung

void SimpleXMLIterator::next ( void )

This method moves the SimpleXMLIterator to the next element.

Parameter-Liste

Diese Funktion hat keine Parameter.

Rückgabewerte

Es wird kein Wert zurückgegeben.

Beispiele

Beispiel #1 Move to the next element

<?php
$xmlIterator 
= new SimpleXMLIterator('<books><book>PHP Basics</book><book>XML basics</book></books>');
$xmlIterator->rewind(); // rewind to the first element
$xmlIterator->next();

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

Das oben gezeigte Beispiel erzeugt folgende Ausgabe:

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


Keine BenutzerBeiträge.
- Beiträge aktualisieren...



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)