cURL / Mailing Lists / curl-users / Single Mail

curl-users

can curl output to a string?

From: Miguel Mendes <boras_at_net.sapo.pt>
Date: 14 Nov 2000 19:22:37 -0000

I'm doing some web fetching, something like this:

$url = "http://www.some-site.com/index.html"

$ch = curl_init ($url);
$fp = fopen ($url, "w");

curl_setopt ($ch, CURLOPT_FILE, $fp);

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

and also using the CURLOPT_PROXY.

Since I want to extract and display only parts of the
output, I have open the file and read it(and that
consumes time!).

Is there a way to output the fetched page directly to a
string, avoiding writing to a file?

an option like this:

$url = "http://www.some-site.com/index.html";
$ch = curl_init ($url);

curl_setopt ($ch, CURLOPT_STRING, $string);

curl_exec ($ch);
curl_close ($ch);

(if there isn´t, here is a sugestion)

   _____________________________________________________________________
netsapo, tudo por nada em http://webnet.sapo.pt. Internet Grátis da Telepac.
Received on 2000-11-14