Longhorn PHP 2025 - Speakers and Schedule Announced!

Voting

: three minus zero?
(Example: nine)

The Note You're Voting On

rukkykf at gmail dot com
6 years ago
I think it's worth mentioning that you need to call the rewind() method on the SimpleXMLIterator object immediately after initialization before you can start doing any other operations on the object. An example:

<?php
$xml
= new SimpleXMLIterator('file.xml', null, true);

// $x here will be set to null because the rewind() method has not been called
$x = $xml->current();

$xml->rewind();

// $x here will be set to the first element
$x = $xml->current();

?>

<< Back to user notes page

To Top