1
Как проверить, есть ли DOMDocument элементыКак проверить, есть ли DOMDocument элементы
код:
$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