CURL vs fsockopen chunking

This may seem strange .. but I need to evaluate / parse the pieces passed over HTTP with PHP.

It should be noted that the HTTP stream can never end. Is there a way to process fragments when I get them using CURL?

Or do I need to resort to some fsockopen() home solution?

+4
source share
1 answer

Take a look at the CURLOPT_WRITEFUNCTION option. You can define a callback that will be called when new data appears in the response. See the manual .

+5
source

All Articles