vinod kumar vinod kumar - 1 month ago 5x
PHP Question

How to get image from any website with url

I need to get image url only from any webpage with php nothing can i get image url please help.

I have try

but its not usefull for me.

Thanks in advance

Ram Ram
$html = file_get_contents($url);
$doc = new DOMDocument();
$tags = $doc->getElementsByTagName('img');
foreach ($tags as $tag) {
echo $tag->getAttribute('src');

Check this code its working for me.