Just a quick not ethis morning about a nifty little class that Colin Viebrock (part of the "PHP Webstite Team" for PHP.net) has posted on his weblog this morning - definitely something that I could have used a long time ago.
The HTTP_URL class is something I quickly hacked together a while ago. It reads a URL and returns and parses the HTTP header and body for various things.
The easiest way to explain is by example:
-------------------------------
require 'HTTP_URL.php';
$url = new HTTP_URL('http://viebrock.ca/');
$url->get();
print_r($url->headers);
$url->parseBody();
print_r($url->refs);
-------------------------------
The result of the above is a large array containing quite a bit of data from the page you pointed it at (including all links, headers, as well as image URLs and framesets). And, from the looks of the source it can be easily enhanced to add additional tags as well...




