title: looping a curl data using php
body: <p>need your help... how can I convert it on looping:</p>
  
  <pre><code>//first
      $url1="https://www.zopim.com/api/v2/chats";
      $ch1 = curl_init();
      curl_setopt($ch1, CURLOPT_URL, $url1);
      curl_setopt($ch1, CURLOPT_USERPWD, "$username:$password");
      curl_setopt($ch1, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
      curl_setopt($ch1, CURLOPT_SSL_VERIFYHOST, 0);
      curl_setopt($ch1, CURLOPT_SSL_VERIFYPEER, 0);
      curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);
      $output1 = curl_exec($ch1);
      $info1 = curl_getinfo($ch1);
      curl_close($ch1);
  
      $chats1 = json_decode($output1,true);
  </code></pre>
  
  <p>for example there's a specific number count to loop like 4 or more numbers...
  then i would like to get all the <code>$chats</code>... and merge..</p>
  
  <p>like this:</p>
  
  <pre><code>$merge_array = array_merge_recursive($chats1, $chats2, $chats3, $chats4);
  </code></pre>
  
  <p>hope you can help me guy's thanks...</p>