Display all links on a web page

Display all links on a web page

<?php

$page = 0;
$URL = “http://www.getphp.net/”;
$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);

?>

LEAVE A REPLY

Please enter your comment!
Please enter your name here

*