title: How to echo result since one single curl request is completed via PHP-cUrl multiple-thread
body: <p>In <code>test.html</code>,<code>demo</code>word included only。</p>
  
  <pre><code>    demo
  </code></pre>
  
  <hr>
  
  <p><code>curl.php</code></p>
  
  <pre><code>&lt;php?
  
  //init curl
  $chArr=[];
  for($i=0;$i&lt;500;$i++){
      $chArr[$i]=curl_init("http://dev.site/test.html");
      curl_setopt($chArr[$i],CURLOPT_RETURNTRANSFER,1);
  }
  
  //create curl
  $mh = curl_multi_init(); 
  foreach($chArr as $k =&gt; $ch){
      curl_multi_add_handle($mh,$ch); 
  }
  
  $running = null;
  
  do{
      curl_multi_exec($mh,$running); 
  }while($running &gt; 0); 
  
  //start multi-thread
  foreach($chArr as $k =&gt; $ch){
      $result[$k]= curl_multi_getcontent($ch);  
  
      //and echo out the result
      echo "$result[$k]\n"      
  
      curl_multi_remove_handle($mh,$ch);
  }
  
  curl_multi_close($mh); 
  </code></pre>
  
  <hr>
  
  <p>I've set 500 requests,about 10s later got the output and there is no response during processing
  <a href="https://i.stack.imgur.com/5casV.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5casV.gif" alt="no response"></a></p>
  
  <hr>
  
  <p>Is there anyway to display the result and give me a Feedback since every single curl request is done,just like below?</p>
  
  <p><a href="https://i.stack.imgur.com/9KHzy.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9KHzy.gif" alt="enter image description here"></a></p>
  
  <hr>
  
  <p>PS:if PHP is hard to do this so,I could accept Nodejs,Python etc.</p>