cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: Help with curl

From: Colin Petit <colin_at_shot1.com>
Date: Fri, 17 Jun 2005 20:09:58 -0500

If you set CURLOPT_RETURNTRANSFER you can store the data in a
variable and then alter it, otherwise it goes straight to the
browser. Try this:

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($ch);
curl_close($ch);

$data = alterDataFunction($data);

echo $data;

On Jun 17, 2005, at 12:56 PM, Arthur Bickle wrote:

Hello, Does anyone know if there is a way to parse and alter the
information coming from

the website before it is sent to the browser?

<?

$url=”http://www.anydomain.com%94;

$ch= curl_init($url);
if(!$ch)
die(sprintf('Error [%d]: %s', curl_errno($ch), curl_error($ch)));

$data=curl_exec($ch);
if(!$data){
die(sprintf('Error [%d]: %s', curl_errno($ch), curl_error($ch)));

}

curl_close ($ch)

?>

Thanks

art

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.7.4/16 - Release Date: 6/15/2005
Received on 2005-06-18