SimpleXMLElement::hasChildren
En esta página
SimpleXMLElement::hasChildren
Verifica si el elemento actual tiene subelementos
Descripción#
public SimpleXMLElement::hasChildren(): bool
```php
> [!WARNING]
> Antes de PHP 8.0, SimpleXMLElement::hasChildren solo estaba declarada en la subclase `SimpleXMLIterator`.
Este método verifica si el objeto actual `SimpleXMLElement` tiene subelementos.
## Parámetros
Esta función no contiene ningún parámetro.
## Valores devueltos
`true` si la entrada actual tiene subelementos, `false` en caso contrario.
## Ejemplos
Verifica si un elemento tiene subelementos
```php
El ejemplo anterior mostrará:
object(SimpleXMLElement)#2 (2) {
["title"]=>
string(10) "PHP Basics"
["author"]=>
string(9) "Jim Smith"
}