how to get image source from an img tag using php function.
$path1 = 'http://example.com/index.html';//path of the html page
$file = file_get_contents($path1);
$dom = new DOMDocument;
@$dom->loadHTML($file);
$links = $dom->getElementsByTagName('img');
foreach ($links as $link)
{
$re = $link->getAttribute('src');
$a[] = $re;
}
Output:
Array
(
[0] => demo/banner_31.png
[1] => demo/my_code.png
)