title: Post request using curl not working - PHP
body: <p>I want to get the response from a PHP post as a string. I'm using curl, based in some references I've found here.</p>
  
  <p>This is my function:</p>
  
  <pre><code>function curlPost($url, $parameters){
  
      $ch = curl_init();
  
      curl_setopt($ch, CURLOPT_URL, $url);
      curl_setopt($ch, CURLOPT_POST, 2);
      curl_setopt($ch, CURLOPT_POSTFIELDS, $parameters);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  
      $response = curl_exec($ch);
  
      curl_close($ch);
  
      return $response;
  }
  </code></pre>
  
  <p>It really seems right, but when I run it, it just doesn't happen anything. I've tried hardcoding $url and $parameter, but it also didn't work.</p>
  
  <p>Any ideas?</p>
  
  <p>Thanks!</p>