I need to count and list image links from a remote page. I tried this code: [CODE] $url = "http://www.siteurl.com/page.html"; $file = fopen ("$url", "r"); if (!($file)) { echo "Not exist!"; exit; } while (!feof ($file)) { $line = fgets ($file, 1024); if (eregi ("HREF=\"(.*).jpg\">", $line, $out)) { $image = $out[1].".jpg"; $pos = strpos($image, "http://"); if ($pos === false) { $image_url = dirname($url)."/".$image; } echo $image_url; } } [/CODE] But it's not working stable on different sites especially only works if the image link codes are on one line. Can anyone suggest any code for listing image links? Thanks in advance.