this is the code i found on phpfreak. i am wondering what i have to add to the script to get the description of the link as well. right now, it just prints the url.
<?php
if ($url) {
$remote = fopen($url, 'r');
$html = fread($remote, 1048576);
fclose($remote);
$urls = '(http|file|ftp)';
$ltrs = '\w';
$gunk = '/#~:.?+=&%@!\-';
$punc = '.:?\-';
$any = "$ltrs$gunk$punc";
preg_match_all("{
\b
$urls :
[$any] +?
(?=
[$punc] *
[^$any]
|
$
)
}x", $html, $matches);
printf("Output of URLs %d URLs<P>\n", sizeof($matches[0]));
foreach ($matches[0] as $u) {
$link = $PHP_SELF . '?url=' . urlencode($u);
echo "<A HREF='$link'>$u</A><BR>\n";
}
}
?>