<?php // RAY_graburls.php
if (empty($_GET["u"])) {
?>
<form action="<?=$PHP_SELF?>" method="get">
URL (like http://www.google.com):
<input type="text" name="u" />
<input type="submit" name="_submit" value="go" />
</form>
<?php
} else {
$url = $_GET["u"];
$html = file_get_contents($url);
$html = strip_tags($html, "<a><img>");
preg_match_all("/(<([\w]+)[^>]*>)(.*)(<\/\\2>)/", $html, $matches, PREG_SET_ORDER);
foreach ($matches as $value) {
$link = htmlentities($value[0]);
echo "<br />$link \n";
}
}
?>
http://www.webmasterworld.com/forum88/6140.htm