PHP children() Function

This method finds the children of an element. The result follows normal iteration rules.

public SimpleXMLElement SimpleXMLElement::children ([ string $ns [, bool $is_prefix = FALSE ]] )

The children() function finds the children of a specified node.

Example -

Example #1 Traversing a children() pseudo-array

Example #2 Using namespaces

ParameterDescription
nsAn XML namespace.
is_prefixIf is_prefix is TRUE, ns will be regarded as a prefix. If FALSE, ns will be regarded as a namespace URL.

Returns a SimpleXMLElement element, whether the node has children or not.