|
SimpleXMLElement::keyReturn current key Description
public string SimpleXMLElement::key()
Warning
Prior to PHP 8.0, SimpleXMLElement::key was only declared on the subclass SimpleXMLIterator. This method gets the XML tag name of the current element. ParametersThis function has no parameters. Return ValuesReturns the XML tag name of the element referenced by the current SimpleXMLElement object. Errors/ExceptionsThrows an Error on failure. Changelog
Examples
Example #1 Get the current XML tag key
The above example will output: bool(false) string(4) "book" |