Hi all,
While not strictly a question about the API directly, I think it's still a handy question to ask. I'm working on a PHP based website to learn web development using Torn's API. If I make something worth sharing, I'm sure I'll be making another post in this forum :)
Anyway, the issue I'm having is that I need to make a few API requests in parallel otherwise the page takes to long to load and times out - I could request sequentially and increase the length of the timeout but I don't particularly want to wait 30+ seconds everytime the page loads.
I know cURL is the answer, I just can't figure out for the life of me how to use it.
Not 100% sure this is where the issue is but I expect it's something to do with: curl_multi_exec() (
I am using the same execution method as the first example on the above link but want to store the results (I assume the JSON provided by the Torn API?) in separate variables so I can work with them later. Pretty sure that loops does not store the contents in the cURL handles? Using: var_dump(curl_multi_getcontent($ch1)) is an empty string: string(0) "". and echoing one of the cURL handles echoes this: resource(1) of type (curl). The number in "resources(x)" is the cURL handle number.
Hopefully, that makes sense! And hopefully someone can point me in the right direction or put me out of misery! It's driving me nuts.
Thanks!