PHP 8.3.4 Released!

SimpleXMLElement::next

(No version information available, might only be in Git)

SimpleXMLElement::next次の要素に移動する

説明

public SimpleXMLElement::next(): void

このメソッドは、SimpleXMLElement を次の要素に移動します。

パラメータ

この関数にはパラメータはありません。

戻り値

値を返しません。

例1 次の要素への移動

<?php
$xmlElement
= new SimpleXMLElement('<books><book>PHP Basics</book><book>XML basics</book></books>');
$xmlElement->rewind(); // 最初の要素に巻き戻します
$xmlElement->next();

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

上の例の出力は以下となります。

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

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top