How to extract linked images out of a html page with PHP/regexp : <p>I'm looking for some PHP code or a rexeg expression (i'm not that skilled about regexp) to extract from a html file just the linked images. In other words, just the chunk of html that looks like:</p>

<pre><code>&lt;a href=...&gt;&lt;img src=...&gt;&lt;/a&gt;
</code></pre>

<p>I know how to extract images and links separately </p>

<pre><code>$links = $dom-&gt;getElementsByTagName('a');
$images = $dom-&gt;getElementsByTagName('img');
</code></pre>

<p>but not how to extract the two tags one inside the other. I have also not found anything by googling it. So is it maybe uncommon or very difficult what I want to do? </p>

<p>Could you help me? Thanks.</p>
