PHP 현재() 함수
예시
첫 번째 요소로 되감고 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());
?>
정의 및 사용
current() 함수는 현재 요소를 반환합니다.
통사론
SimpleXMLIterator::current()
기술적 세부 사항
반환 값: | 성공 시 현재 요소(SimpleXMLIterator 개체)입니다. 실패 시 NULL |
---|---|
PHP 버전: | 5.0+ |
❮ PHP SimpleXML 참조