title: Sending Multiple Asyncronous PHP cURL requests
body: <p>I am using PHP cURL to and it is returning a json response. What I want to be able to do is send multiple requests at the same time to test the program to make sure it can handle multiple requests simultaneously. At the moment I am trying with the below code:-</p>
  
  <p><strong>JQUERY</strong></p>
  
  <pre><code>$(function() {
  
      var MAXNUM = 9;
  
      function newAsyncRequest() {
          setTimeout(function() {
              var val = Math.floor(Math.random() * (MAXNUM+1));
              if (val !== 0)
                  newAsyncRequest();
              console.log(val);
          }, 1000);
      }
  
      newAsyncRequest();
  
  });
  
  
  function asyncFunction(session) {
      (new Request({
          url: test.php,
          onComplete: function (response) {
  
              // Do something???
  
          }
      })).get();
  }   
  </code></pre>
  
  <p><strong>PHP</strong></p>
  
  <pre><code>function sendPostcodeRequest() {
  
      require_once('scripts/php/controllers/curl.controller.php');
  
      $postcode = 'LE11 3SA';
      $postcode = rawurlencode($postcode);
  
      $uri = 'http://192.168.1.110:8290/?pc='.$postcode; // Home
  
      $response = CurlController::request($uri);
  
  }
  </code></pre>
  
  <p>Basically I am wanting to run <code>sendPostcodeRequest();</code> PHP say 1000 times asynchronously.</p>
  
  <p>Any help on this would be much appreciated. </p>