It's probably best to go at this in stages.
First, find all the <img> tags. What should work (off the top of my head) is this:
$number_of_images_found = preg_match_all('/<img[^>]*src\s*=\s*([^ >]+)\s?[^>]*>/i', $html, $matches);
(Syntax highlighting turned off to avoid vBulletin bug).
Summat like that, anyway.
And in $matches[1] would be the contents of the <img> src= attributes, though still with quotes attached. I'd've liked to match and discard them in advance, but some people still insist on leaving them off, and I'm not in the mood to tackle the possibility in a regexp just now.
So instead, what's needed now is to look at the first character. if it's a ' or a ", trim off the first and last character.
$images=array();
foreach($matches[1] as $imgsrc)
{ if(substr($imgsrc,0,1)=="'" || substr($imagesrc,0,1)=='"')
$images[]=substr($imgsrc,1,-1);
else
$images[]=$imgsrc;
}
That's my first cut at the job.
Needlessto say, you'll want to do $images=array_unique($images); after that so's you don't go asking for the same image twice (and don't trust the value of $number_of_images_found for the same reason!).