title: optimisation of curl request
body: <p>i'm developing a task report with wrike and i would like to know if it's possible to make it faster. I'm not confortable with curl, I'm not use to use it. All help will welcome :).</p>
  
  <pre><code>    $ch = curl_init();
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
      curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
      $headers = array();
      $headers[] = "Authorization: bearer ".$_COOKIE["wrike_token"];
      curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  
      foreach($folderArray as $currentFolder){
  
          curl_setopt($ch, CURLOPT_URL, "https://www.wrike.com/api/v3/folders/".$currentFolder-&gt;id."/tasks?completedDate={'start':'2016-10-11T00:01:00Z','end':'2016-10-11T23:59:00Z'}");
          $result = curl_exec($ch);
          $result = json_decode($result);
  
          if(!empty($result-&gt;data)){
              foreach($result-&gt;data as $currentTask){
                  echo $currentFolder-&gt;title." : ".$currentTask-&gt;title."&lt;br&gt;";
              }
          }
          if (curl_errno($ch)) {
              echo 'Error:' . curl_error($ch);
          }                   
      }       
      curl_close ($ch);`
  </code></pre>