How to run two 'foreach' codes together to get output as one?
<p>I have two <code>foreach</code> loops. One gives <code>image href="URL"s</code> and the other gives <code>image src="URL"s</code>.</p>

<p>How do I combine these two loops together and display images?</p>

<p>My code which gives image HREFs:</p>

<pre><code>foreach($doc-&gt;getElementsByTagName('a') as $a){
    foreach($a-&gt;getElementsByTagName('img') as $img){
        echo $a-&gt;getAttribute('href');
    }
}
</code></pre>

<p>My code which gives image SRCs:</p>

<pre><code>foreach($html-&gt;find('img') as $e)
    echo $e-&gt;src . '&lt;br&gt;';
</code></pre>
