1
如何檢查DOM文檔是否有項目如何檢查DOM文檔是否有項目
代碼:
$iframe = $dom->getElementsByTagName('iframe');
foreach ($iframe as $if) {
//how to check whether $if has items for
// $if->item(0) so that I can access it without errors?
}
'$ if-> item(0)'或'$ iframe-> item(0)'?請參閱[DOMNodeList](http://php.net/manual/en/class.domnodelist.php)。 – hakre 2012-04-13 00:29:29