how can I make an asynchronous HTTP request in PHP passing a delegate to the function?
Thanks
how can I make an asynchronous HTTP request in PHP passing a delegate to the function?
Thanks
PHP doesn't really support async callbacks since there are no interrupts in the language. Your best of using curl, and then checking back on the request to see if it has finished. You can also use fsockopen
and friends to do it on a socket level.
Check out this post. You'll need to tweak it to save the result socket (and process it), but the basic idea is there.