How to get jpg image url from a website using php script

I want to get all jpg images url from a website.Please help to resolve this issue.

Hi tahirsatti, welcome to forum

Did you try glob()
What code are you using that you’re having trouble with?

i am using below mentioned code.Using this code i am able to extract image url from first page but it is not showing image url’s of sub pages.

<?php
include_once('simple_html_dom.php');
$target_url = "http://fffmovieposters.com/";
$html = new simple_html_dom();
$html->load_file($target_url);
foreach($html->find('img') as $img)
{
echo $img->src."<br />";
echo $img."<br/>";
}
?>

Thanks.

Out of interest why do you want to get all the jpg images?

I assume if they are yours you would have them already.

actually i am working on a crawler and i require images url from a website.

You should contact the website and get the API information from them.

As any other method is theft, further assistance would be against SitePoint forum policy.

Topic Closed

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.