tags:

views:

41

answers:

2

I currently use curl_multi_* to connect to a few sites. Its only sending a few $_GET variables to start a script, but it outputs the html from the sites to the browser. I want to stop this. I already use a short timeout, but sometimes the scripts start fast, and I don't want to set the timeout any lower, in case it causes it not to connect.

So how can I stop the output to the browser from cURL?

+3  A: 

curl_setopt($handle, CURLOPT_RETURNTRANSFER, true)

This will cause curl_exec to return the content of the URL as a string. Not sure what the implication are when using curl_multi.

prodigitalson
Well I'll test it out and tell you what happens with curl_multi
Rob
Tried it out. Works fine with curl_multi, assuming you add the handles to it correctly. Thanks! :D
Rob
A: 

CURLOPT_RETURNTRANSFER...

ircmaxell