Re: Redirecting cURL output to a variable?
| From: | Andrei Zmievski | Date: | Mon, 21 Aug 2000 14:54:13 +0000 |
| Subject: | Re: Redirecting cURL output to a variable? | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-30064@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.
-Andrei
UNIX is like sex: If you don't know it, you don't miss it. But if
you know it, you'll need it. -- Anonymous.