php8.5
Home/ Manual/ reference / simplexml/ The SimpleXMLElement class

The SimpleXMLElement class

Represents an element in an XML document.

Intro

Represents an element in an XML document.

Class synopsis

class SimpleXMLElement implements Stringable implements Countable implements RecursiveIterator { }

Changelog

VersionDescription
8.4.0Get methods (such as SimpleXMLElement::asXML or SimpleXMLElement::getName) and casting a SimpleXMLElement to a String no longer implicitly rewind the iterator. The iterator must now be rewound explicitly, using SimpleXMLElement::rewind, where needed.
8.0.0SimpleXMLElement implements Stringable, Countable, and RecursiveIterator now.

Simplexmlelement

In this section

Source: reference/simplexml/simplexmlelement.xml · from the official PHP manual (php/doc-en)