I have the following links:
<a href="http://example.com/src/abc.png"><img src="http://example.com/res/bca.png"></a>
<a href="http://example.com/src/hvc.gif"><img src="http://example.com/res/ncq.jpg"></a>
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.
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.
Any help would be appreciated.