How to check whether domdocument has items
<p>How to check whether domdocument has items</p>

<p>code:</p>

<pre><code> $iframe =  $dom-&gt;getElementsByTagName('iframe');


 foreach ($iframe as $if) {

    //how to check whether $if has items for
     // $if-&gt;item(0) so that I can access it without errors?
 }
</code></pre>
