title: Return POST Request, Then Execute CURL
body: <p>I am creating an API that receives a post request and then returns data. This data needs to be returned immediately but then I need to execute a long running curl operation after that. </p>
  
  <pre><code>&lt;?php
  if (!empty($_POST)) {
      $numbers = isset($_POST['numbers']) ? $_POST['numbers'] : 0;
      $numbers = $numbers*$secrethash;
      $result = array("error" =&gt; false,
          "numbers" =&gt; $numbers);
      echo json_encode($result);
      $curlfunction($numbers);
      exit;
  </code></pre>
  
  <p>Unfortunately, data is not returned until the curl function completes which causes my application to timeout. It is possible to execute the curl in the background so my data can be returned immediately? </p>