Re: Redirecting cURL output to a variable?
| From: | Sterling Hughes | Date: | Mon, 21 Aug 2000 17:11:29 +0000 |
| Subject: | Re: Redirecting cURL output to a variable? | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-30077@lists.php.net to get a copy of this message | ||
>On Mon, 21 Aug 2000, Sterling Hughes wrote:
>>
>> Yup, set the CURLOPT_RETURNTRANSFER to 1:
>>
>> <?php
>>
>> $ch = curl_init ("http://www.php.net/");
>> // Set this to one to have curl_exec() return
>> // the results of the transfer. You can not use
>> // CURLOPT_FILE if you have CURLOPT_RETURNTRANSFER
>> // set.
>> curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
>> $output = curl_exec ($ch);
>> curl_close ($ch);
>>
>> $output = strtolower ($output);
>
>This is a little cumbersome. Setting a bunch of options just to have a
>simple transfer done? Perhaps, it'd be worth building a PHP class around
>this extension.
>
Its on my TODO list...
Sterling