IT. Expert System.

PHP

Returns the sub-elements of the current element


SimpleXMLIterator::getChildren

(PHP 5 >= 5.1.0)

SimpleXMLIterator::getChildrenReturns the sub-elements of the current element

Description

SimpleXMLIterator SimpleXMLIterator::getChildren ( void )

This method returns a SimpleXMLIterator object containing sub-elements of the current SimpleXMLIterator element.

Parameters

This function has no parameters.

Return Values

Returns a SimpleXMLIterator object containing the sub-elements of the current element.

Examples

Example #1 Return the sub-elements of the current element

<?php
$xml 
= <<<XML
<books>
    <book>
        <title>PHP Basics</title>
        <author>Jim Smith</author>
    </book>
    <book>XML basics</book>
</books>
XML;

$xmlIterator = new SimpleXMLIterator($xml);
for( 
$xmlIterator->rewind(); $xmlIterator->valid(); $xmlIterator->next() ) {
    foreach(
$xmlIterator->getChildren() as $name => $data) {
    echo 
"The $name is '$data' from the class " get_class($data) . "\n";
    }
}
?>

The above example will output:

 The title is 'PHP Basics' from the class SimpleXMLIterator The author is 'Jim Smith' from the class SimpleXMLIterator 



Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 2763 / . Delta: 0.19574 с