Hi All,

I have one requirement that, i am displaying results getting from various sites by sending request to their servers using http_client::get method.But it is taking much longer time to get back the response.
I am using for loop to send the requests to all the servers(approx 40).So it is taking around 10 secs to complete all the requests.

Please can you suggest me is there any way to send all the requests in a single attempt and get back the response in the same order.

Is php Supports multithreading?.If so, how can we solve this problem using multithreading.

I tried in many ways and didn't found any solution for my problem.Please help me to get out from this .

PHP has no built-in functionality for threading. You can fake it by using shell calls to fork php processes but that is a far cry from multithreading.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.