Re: Retrieving text from a URL using PHP
| From: | Anthony Ritter | Date: | Thu, 06 Jun 2002 16:11:58 +0000 |
| Subject: | Re: Retrieving text from a URL using PHP | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-100940@lists.php.net to get a copy of this message | ||
Thank you Jason.
I'm still trying to figure out how to implement the strip_tags() function on
the script below so that the output of the URL is straight text.
Please advise if you get a chance.
TR
.................................................
<html>
<head>
<title>Retrieving text from a URL</title>
</head>
<body>
<?
$theurl="http://www.blah.com";
if (!($fp=fopen($theurl, "r")))
{
echo "Could not open the URL";
exit;
}
$contents= fread($fp, 1000000);
fclose($fp);
echo "$contents";
echo "<br>"."This information retrieved from<br>"."<a
href=\"$theurl\">$theurl</a><br>"."on ".(date("l jS F Y
g:i a T"));
?>
</body>
</html>