extracting URLs
Posted: Fri Feb 17, 2006 9:46 pm
I was wondering if it was possible to extract all URLs from a file and list them. does anyone have an idea on how to do this. pretty much I need to extract URLs from an RSS feed.
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
<?php
$page = 0;
$URL = "http://www.thewebsite.com/thepage";
$page = @fopen($URL, "r");
print("Links at $URL<BR>\n");
print("<UL>\n");
while(!feof($page)) {
$line = fgets($page, 255);
while(eregi("HREF=\"[^\"]*\"", $line, $match)) {
print("<LI>");
print($match[0]);
print("<BR>\n");
$replace = ereg_replace("\?", "\?", $match[0]);
$line = ereg_replace($replace, "", $line);
}
}
print("</UL>\n");
fclose($page);
?>yeah I know that, but RSS was just an example MinDFree's snipet was much more helpfullquocbao wrote:There are many classes for reading RSS on PHPClasses , you can use one of them