tidyNode::hasChildren

(PHP 5, PHP 7, PHP 8)

tidyNode::hasChildrenChecks if a node has children

Description

publictidyNode::hasChildren(): bool

Tells if the node has children.

Parameters

This function has no parameters.

Return Values

Returns true if the node has children, false otherwise.

Examples

Example #1 tidyNode::hasChildren() example

<?php

$html
= <<< HTML
<html><head>
<?php echo '<title>title</title>'; ?>
<#

alert('Hello World');
#>
</head>
<body>

<?php

The above example will output:

bool(true) bool(false)
To Top