The SimpleXMLIterator class
(PHP 5, PHP 7, PHP 8)
Introduction
The SimpleXMLIterator provides recursive iteration over all nodes of a SimpleXMLElement object.
Class synopsis
/* Inherited methods */
public function SimpleXMLElement::__construct(
string
int
bool
string
bool
)
string
$data,int
$options = 0,bool
$dataIsURL = false,string
$namespaceOrPrefix = "",bool
$isPrefix = false)
public function SimpleXMLElement::addAttribute(string
$qualifiedName, string $value, ?string $namespace = null): voidpublic function SimpleXMLElement::addChild(string
$qualifiedName, ?string $value = null, ?string $namespace = null): ?SimpleXMLElementpublic function SimpleXMLElement::attributes(?string
$namespaceOrPrefix = null, bool $isPrefix = false): ?SimpleXMLElementpublic function SimpleXMLElement::children(?string
}$namespaceOrPrefix = null, bool $isPrefix = false): ?SimpleXMLElementChangelog
| Version | Description |
|---|---|
| 8.0.0 | Iterator methods (SimpleXMLIterator::hasChildren(), SimpleXMLIterator::getChildren(), SimpleXMLIterator::current(), SimpleXMLIterator::key(), SimpleXMLIterator::next(),SimpleXMLIterator::rewind(), SimpleXMLIterator::valid()) were moved to SimpleXMLElement. |
| 8.0.0 | SimpleXMLIterator implements Stringable now. |
来源:PHP Documentation Group · 作者与贡献记录 · CC BY 3.0。离线整理了版式、链接和媒体显示。
