Web Content: Crawl Image Source a Web Page

Web Content Tips - Part 8: At the previous post, we crawl and show all url in a web page. Now, we want to filter, crawl only for images. You can modify preg_match_all like this:
$url  = "http://localhost:8048/blog/index.php";
$data = file_get_contents($url); 

preg_match_all("/(src)=(\"|')*[^<>[:space:]]+[[:alnum:]#?\/&=+%_]/", $data, $match);

$list = $match[0];



Bookmark and Share Tag: web content, image Category: PHP Basic Post : April 28th 2008 Read: 5,049


blog comments powered by Disqus