phpeveryday.com

The best tutorial of php, php framework, php strategies, object oriented oriented,


Web Content: Crawl Image Source a Web Page

Tag: web content, image   Category: PHP Basic
post: 28 Apr 2008 read: 162


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:

<?php
$url  = "http://localhost:8048/blog/index.php";
$data = file_get_contents($url); 

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

$list = $match[0];

print_r($list);


?>



| Give Your Opinion | Recommend
Share and Bookmark to: These icons link to social bookmarking sites where readers can share and discover new web pages.
digg del.icio.us technorati Ma.gnolia BlinkList

Recommended articles by other readers:
Web Services: How PHP Kiss VB.NET? (Part 1)
Chart: How to Build Cool Animation Real Time Chart
Joomla: Fast Road to Understand Component Programming
Email: Send Attachement Mail
mod_rewrite - Part 1: create your "fantasy" URL

What do You Think?
Your Name *:
Email *:
(Will not be published)
Website/URL:
Your Comment *:
* Required


615
posting