DOMNode->hasChildNodes()

(no version information, might be only in CVS)

DOMNode->hasChildNodes() --  Checks if node has children

说明

class DOMNode {

bool hasChildNodes ( void )

}

This function checks if the node has children.

返回值

如果成功则返回 TRUE,失败则返回 FALSE


add a note add a note User Contributed Notes
10-Aug-2006 03:12
If you are new to DOM as I am, note that
hasChildNodes() returns true even when the child nodes are not elements -- in other words:

<books>
  <book>text</book>
</books>

$node->hasChildNodes() returns true for the node BOOK.