FN-FORUM: relative link finder in HTML
date posted 11th August 2005 12:30
hi FN
im in need of a relative link finder
something of the sort (which doesnt quite work):
print_links("index.html");
function print_links( $domain ) {
$fp = fopen( $domain, "r" ) or die("Could not contact ".$website);
$page_contents = "";
while( $line = fread( $fp, 4096 ) ) { $page_contents .= $line; }
preg_match_all( '/([^>]*)/i',
$page_contents, $aMatches, PREG_SET_ORDER );
print_r($aMatches);
foreach( $aMatches as $link ) {
echo "Text: " . $link[2] . "Link: " . $link[1] .
"";
}
ta
a.