开发者

How can I stop cURL from outputting the contents of the page it loads into the browser?

开发者 https://www.devze.com 2023-01-03 23:36 出处:网络
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

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 an开发者_Python百科y lower, in case it causes it not to connect.

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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消