$ul = $dom->getElementsByTagName('ul')[0]; $liList = $ul->getElementsByTagName('li');
$div = $dom->getElementById('myDiv'); $imgList = $div->getElementsByTagName('img');In both cases, the method returns an array-like object (a DOMNodeList) that contains all the child elements that match the provided tag name. The PHP DOMElement class is part of the PHP DOM library, which provides a set of classes and functions for parsing and manipulating XML and HTML documents.