Re: PHP 4.0 Bug #8318: Feature request for cURL
| From: | sterling hughes | Date: | Tue, 19 Dec 2000 11:11:32 +0000 |
| Subject: | Re: PHP 4.0 Bug #8318: Feature request for cURL | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-41834@lists.php.net to get a copy of this message | ||
paul@rydell.com wrote:
>
> From: paul@rydell.com
> Operating system: All
> PHP version: 4.0.3pl1
> PHP Bug Type: Feature/Change Request
> Bug description: Feature request for cURL
>
> I would like to use cURL to read the HTML (or whatever I am fetching) directly into a variable
> instead of only into a file or STDOUT.
>
> Something like:
>
> $ch = curl_init("http://www.somepage.com/");
> curl_setopt($ch,CURLOPT_VARIABLE,$myoutput);
> curl_exec($ch);
> print $myoutput;
>
you can set the CURLOPT_RETURNTRANSFER option:
$ch = curl_init("http://www.somepage.com/");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$myoutput = curl_exec($ch);
curl_close($ch);
-sterling