title: prevent curl from directly echo/output returned data
body: <p>I did a Post request with Curl on PHP. The instagram API returns a small json with the status. But somehow my code echos it and I want to get it to a variable instead.</p>
  
  <pre><code>//open connection
  $ch = curl_init();
  
  //set the url, number of POST vars, POST data
  curl_setopt($ch,CURLOPT_URL, $url);
  curl_setopt($ch,CURLOPT_POST, 1);
  curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
  
  //execute post
  $result = curl_exec($ch);
  
  //close connection
  curl_close($ch);
  </code></pre>
  
  <p>Why does it echo or print the $result instead of just keeping it?</p>