2

how can I make an asynchronous HTTP request in PHP passing a delegate to the function?

Thanks

1

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.