This code will help you to extract img src url from any html document

$url="http://example.com";

$html
= file_get_contents($url);

$doc
= new DOMDocument();
@$doc->loadHTML($html);

$tags
= $doc->getElementsByTagName('img');

foreach ($tags as $tag) {
echo $tag
->getAttribute('src');
}