I have simple POST CURL request script,
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_POST, 1);
$result = curl_exec($ch);
The problem i am facing is, if i fetch post data from db or i fetch post data from a form, when i process data in large quantity, for example 60 times. The curl displays the output until and unless all 60 requests are completed.
I want the curl to display output one by one not all at once when the query is completed e.g.
Echo 1st Response Echo 2nd Response Echo 3rd Response
What you are requesting appears to be undefined.
PHP, and any other HTTP Server can only start sending data, when the data-length is know. When echo
ing, your server is supposed to assemble the reply, then organize a transfer.
If you want to assemble a document, that can be done, use AJAX, or any other request/reply system to assemble div
s/fields each.
An example would be:
"Base
document" -> [N] divs or fields. Each field requests its related procesing. When base
receives data, it assembles in its related div.