title: Getting image links from HTML
body: <p>I have the following links:</p>
  
  <pre><code>&lt;a href="http://example.com/src/abc.png"&gt;&lt;img src="http://example.com/res/bca.png"&gt;&lt;/a&gt;
  &lt;a href="http://example.com/src/hvc.gif"&gt;&lt;img src="http://example.com/res/ncq.jpg"&gt;&lt;/a&gt;
  </code></pre>
  
  <p>Using PHP, I would like to be able to get the links only containing src in the image URL, and these must only be images (png, gif, jpg etc.) The problem I have is that I am unaware of the contents of the file, but certain that it contains links which look like the ones above; as in, I do not know the filenames of the images. </p>
  
  <p>In short, is there any way to get all of the links (only the ones containing src in the filename) using PHP, and put them in an array or a string? I already have the source of the page (containing the image links) as $html.</p>
  
  <p>Any help would be appreciated.</p>