4

This may seem kind of weird.. but I need to evaluate/parse chunks being sent over HTTP with PHP.

It's of note to say that the HTTP stream may never end. Is there any way I can parse chunks as I get them with CURL?

Or do I have to resort to some home-brewed fsockopen() solution?

David Titarenco
  • 32,662
  • 13
  • 66
  • 111

1 Answers1

5

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

Artefacto
  • 96,375
  • 17
  • 202
  • 225