TECH I.S.

PHP rewind() 関数

❮ PHP SimpleXML リファレンス

最初の要素に巻き戻し、それを返します (current() を使用):

<?php $note=<<<XML <note> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Do not forget me this weekend!</body> </note> XML; $xml = new SimpleXMLIterator($note); // rewind to the first element $xml->rewind(); // return current element var_dump($xml->current()); ?>

実行例 »


定義と使用法

rewind() 関数は、最初の要素に巻き戻します。


構文

SimpleXMLIterator::rewind()

技術的な詳細

戻り値:

なし

PHP バージョン:

5.0+

❮ PHP SimpleXML リファレンス