I need to get image url only from any webpage with php nothing else.how can i get image url please help.
I have try file_get_contents(url);
but its not usefull for me.
Thanks in advance
I need to get image url only from any webpage with php nothing else.how can i get image url please help.
I have try file_get_contents(url);
but its not usefull for me.
Thanks in advance
$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');
}
Check this code its working for me.