开发者

CURLOPT_RETURNTRANSFER with curl_multi

开发者 https://www.devze.com 2023-01-13 21:40 出处:网络
I\'m using the curl_multi functions with PHP. I already know that you can return the request contents from curl_exec when the CURLOPT_RETURNTRANSFER flag is on. However, how can we grab the request co

I'm using the curl_multi functions with PHP. I already know that you can return the request contents from curl_exec when the CURLOPT_RETURNTRANSFER flag is on. However, how can we grab the request contents of multiple requests as strings when using curl_multi_exec?

Does it return an array when this flag is set? Nope, curl_multi_exec can o开发者_运维百科nly return true or false, without the option to return the contents like the normal one.


Turns out, the curl_multi_getcontent function, while somewhat inelegant, works for getting the contents as strings from each individual curl handle.

0

精彩评论

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