close

<?php
$xmlIterator = new SimpleXMLIterator('<books><book>PHP Basics</book><book>XML basics</book></books>');
$xmlIterator->rewind(); //後退到第一個元素
$xmlIterator->next();

var_dump($xmlIterator->current());
?>
The above example will output:

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

arrow
arrow
    全站熱搜

    stockwfj3 發表在 痞客邦 留言(0) 人氣()