PHP next() 함수
예시
첫 번째 요소로 되감고 다음 요소로 이동한 다음 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();
// move to the next element
$xml->next();
//
return current element
var_dump($xml->current());
?>
정의 및 사용
next() 함수는 다음 요소로 이동합니다.
통사론
SimpleXMLIterator::next()
기술적 세부 사항
반환 값: | 아무것도 |
---|---|
PHP 버전: | 5.0+ |
❮ PHP SimpleXML 참조