The SimpleXMLIterator class
(PHP 5 >= 5.1.3, PHP 7, PHP 8)
Introduction
The SimpleXMLIterator provides recursive iteration over all nodes of a SimpleXMLElement object.
Class synopsis
$qualifiedName
, string $value
, ?string $namespace
= null
): void$qualifiedName
, ?string $value
= null
, ?string $namespace
= null
): ?SimpleXMLElement$namespaceOrPrefix
= null
, bool $isPrefix
= false
): ?SimpleXMLElement$namespaceOrPrefix
= null
, bool $isPrefix
= false
): ?SimpleXMLElement$recursive
= false
, bool $fromRoot
= true
): array|falseChangelog
Version | Description |
---|---|
8.0.0 | SimpleXMLIterator implements Stringable now. |
Table of Contents
- SimpleXMLIterator::current — Returns the current element
- SimpleXMLIterator::getChildren — Returns the sub-elements of the current element
- SimpleXMLIterator::hasChildren — Checks whether the current element has sub elements
- SimpleXMLIterator::key — Return current key
- SimpleXMLIterator::next — Move to next element
- SimpleXMLIterator::rewind — Rewind to the first element
- SimpleXMLIterator::valid — Check whether the current element is valid