Go Back   Forum Care Forums > Development Reference Area > Php Development

Reply
 
LinkBack Thread Tools Display Modes
Read contents of webpage output
Old
  (#1)
Guest
Guest
 
Posts: n/a
Default Read contents of webpage output - 05-14-2007, 03:36 AM

I'm trying to read the output of a webpage into a string.

I know about file_get_contents but that gives me the source of the
page, not the output.

Is it possible to get the output into a string?

Any help appreciated.

--
Ala.

   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Re: Read contents of webpage output
Old
  (#2)
P Pulkkinen
Guest
 
Posts: n/a
Default Re: Read contents of webpage output - 05-14-2007, 03:36 AM

Alhtough I have not needed=applied this, I believe your answer lies in curl
functions. Please anyone, correct me, if I am wrong.

http://www.php.net/manual/en/ref.curl.php

<?php

$ch = curl_init("http://www.example.com/");
$fp = fopen("example_homepage.txt", "w");

curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);

curl_exec($ch);
curl_close($ch);
fclose($fp);
?>


   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Contact Us - Forum Care Forums - Archive - Top