title: PHP Curl Multi post json data
body: <p>I got stuck for 2 hours on this php curl multiple request</p>
  
  <p>i wantta make post json data start from 1111(This is a start point and as a verificationCode) to 1121(end point 1111 + $process_count)</p>
  
  <p>check this out guys :</p>
  
  <pre><code>&lt;?php
  $url = "https://api.mywebsite.com/myapp/customer/verification";
  $mh = curl_multi_init();
  $handles = array();
  
  $process_count = 10;
  
  for($c=1111;$c &lt;= 1121;$c++){
    $data_verification = array(
        "phone" =&gt; "+6285643103039", // +6285643103039 9025
        "verificationCode" =&gt; $c
    );
    $str_verification = json_encode($data_verification);
  }
  
  while ($process_count--)
  {
  
      $ch = curl_init($url);
      $headers= array('Accept: application/json','Content-Type: application/json');
      curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
      curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
      curl_setopt($ch, CURLOPT_HEADER, FALSE);
      curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
      curl_setopt($ch, CURLOPT_TIMEOUT, 4000);
      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
      curl_setopt($ch, CURLOPT_POSTFIELDS,$str_verification);
      curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
      ob_start();
      curl_multi_add_handle($mh, $ch);
      $handles[] = $ch;
  }
  $running=null;
  do
  {
      curl_multi_exec($mh, $running);
  }
  while ($running &gt; 0);
  for($i = 0; $i &lt; count($handles); $i++)
  {
      $out = curl_multi_getcontent($handles[$i]);
      echo "$i. ";
      print $out . "\r\n";
      echo "&lt;br&gt;";
      curl_multi_remove_handle($mh, $handles[$i]);
  }
  curl_multi_close($mh);
  ?&gt;
  </code></pre>
  
  <p>But
  curl_setopt($ch, CURLOPT_POSTFIELDS,$str_verification); always given end point value 1121.</p>
  
  <p>And doesn't looping</p>
  
  <p>from 1111 to 1121.</p>
  
  <p>Anyone can figure it out ? i'll glad for any help</p>