|
SimpleXMLElement::hasChildrenChecks whether the current element has sub elements Description
public bool SimpleXMLElement::hasChildren()
Warning
Prior to PHP 8.0, SimpleXMLElement::hasChildren was only declared on the subclass SimpleXMLIterator. This method checks whether the current SimpleXMLElement element has sub-elements. ParametersThis function has no parameters. Return Values
Examples
Example #1 Check whether the current element has sub-elements
The above example will output: object(SimpleXMLElement)#2 (2) { ["title"]=> string(10) "PHP Basics" ["author"]=> string(9) "Jim Smith" } |