Skip to content
Related Articles

Related Articles

PHP | SimpleXMLIterator next() Function

View Discussion
Improve Article
Save Article
  • Last Updated : 29 Aug, 2019
View Discussion
Improve Article
Save Article

The SimpleXMLIterator::next() function is an inbuilt function in PHP which is used to move the SimpleXMLIterator element to the next element.


void SimpleXMLIterator::next( void )

Parameters: This function does not accept any parameters.

Return Value: This function does not return any value.

Below program illustrates the SimpleXMLIterator::next() function in PHP:


// Store the xml element to variable
$xml = <<<XML
        <address>Noida India</address>
$xmlIt = new SimpleXMLIterator($xml);
// Use rewind() function to rewind
// to the first element
// Use next() function to move
// to the next element
// Display the current element


object(SimpleXMLIterator)#2 (2) {
  string(21) ""
  string(13) "+91-987654321"


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!