Re: reading remote page content
| From: | Eric Bolikowski | Date: | Tue, 10 Feb 2004 11:50:01 +0000 |
| Subject: | Re: reading remote page content | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-177269@lists.php.net to get a copy of this message | ||
"Hamid Hossain" <hamidhossain@hotmail.com> wrote in message
news:Law11-F88zwLsnvJ7du0003355a@hotmail.com...
> I wants to read some pages throug http call. Then, I am going to parse the
> returned string and do some process.
>
> For example: I want to get the latest news from CNN.com daily. So, I want
to
> call http://www.cnn.com and retrieve CNN's homepage
> content in a variable
as
> a string. After that, I will apply some RegExp to extract what I want.
>
>
> Regards,
> Hamid Hossain
>
> -----------------------
> Check Amazon.com Latest PHP books:
>
http://www.amazon.com/exec/obidos/redirect?tag=zawraqclassif-20&path=tg/browse/-/295223
>
> Start Accepting CreditCard at your site in minutes:
> http://www.2checkout.com/cgi-bin/aff.2c?affid=106720
>
> Download Alexa Tool Bar to stop Pop-ups for FREE:
> http://download.alexa.com/?amzn_id=zawraqclassif-20
>
> Download Ready-Made Templates for your site:
> http://www.aplustemplates.com/cgi/affiliates/c1.cgi/zawraq_ad
>
>
<?php
$fp = fopen('http://www.cnn.com/',
'r');
while($cnn .= fread($fp, 100));
fclose($fp);
print $cnn;
?>