我在计算包含来自html页面的DOMnode的以下数组$节点时遇到问题:
@$dom_object = new DOMDocument();
@$dom_object->loadHTML($content);
$xPath = new DOMXPath($dom_object);
$nodes = $xPath->query('//div[@class="giaeffettuate"]');
count($nodes); // returns 1
count((array) $nodes); // returns 0
为什么?