"Brandon Holtsclaw" <[EMAIL PROTECTED]> a écrit dans le message de
news:[EMAIL PROTECTED]
> try something like
>
> $handle = fopen ("http://www.pagetoget.com/thispage.html";, "rb");
> $contents = "";
> do {
>     $data = fread($handle, 1024);
>     if (strlen($data) == 0) {
>         break;
>     }
>     $contents .= $data;
> } while(true);
> fclose ($handle);
>

>From the PHP manual:
// Another example, let's get a web page into a string.  See also
file_get_contents().
$html = implode ('', file ('http://www.example.com/'));

> then you have all text from the .html page in $contents and you can do a
> fwrite on it to a local file, echo it, str_rep etc etc etc
>
> Brandon Holtsclaw
> [EMAIL PROTECTED]
>
>
> ----- Original Message ----- 
> From: "Mike Mapsnac" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, May 10, 2004 10:37 AM
> Subject: [PHP] Save page
>
>
> > Hello
> >
> > I' m writing php script that will request page and save it locally. The
> page
> > URL will be parameter (example: http://www.pagetoget.com/thispage.html).
> How
> > php can request such page and save it locally on the file?
> >
> > Thanks

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to