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

curl-and-php

RE: meaningless characters

From: Fluteau Jerome ICM N PG U PLM A 2 <jerome.fluteau_at_siemens.com>
Date: Mon, 17 Feb 2003 16:00:56 +0100

Hi all,

I don't know why you are using ob_start() at the beginning of your code...I
would do it this way:

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01;
Windows NT 5.0)");

ob_start();
curl_exec($ch);
$string = ob_get_contents();
ob_end_clean();
curl_close($ch);
echo $string;

Hope this helps.

-----Original Message-----
From: Daniel Stenberg [mailto:daniel_at_haxx.se]
Sent: Monday, February 17, 2003 3:51 PM
To: curl and php list
Subject: Re: meaningless characters

On Mon, 17 Feb 2003, Cenk Uysal wrote:

> here is the php code that i use to get html in $buffer:
>
> ob_start();
>
> $ch = curl_init();
> curl_setopt($ch, CURLOPT_URL, $url);
> curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE
> 5.01; Windows NT 5.0)");
>
> $de = curl_exec($ch);
>
> $buffer = ob_get_contents();
> ob_end_clean();

I have absolutely no idea. I'm not a PHP hacker, and thus when things like
ob_get_contents() enters, I'm lost.

Anyone else?

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2003-02-17