title: file_get_contents or curl in php?
body: <p>Which of <code>file_get_contents</code> or <code>curl</code> should be used in PHP to make an HTTP request?</p>
  
  <p>If <code>file_get_contents</code> will do the job, is there any need to use <code>curl</code>?  Using <code>curl</code> seems to need more lines.</p>
  
  <p>eg: </p>
  
  <p><strong>curl:</strong></p>
  
  <pre><code>$ch = curl_init('http://www.website.com/myfile.php'); 
  curl_setopt($ch, CURLOPT_POST, true); 
  curl_setopt($ch, CURLOPT_POSTFIELDS, $content); 
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
  $output = curl_exec ($ch); 
  curl_close ($ch); 
  </code></pre>
  
  <p><strong>file_get_contents:</strong></p>
  
  <pre><code>$output = file_get_contents('http://www.website.com/myfile.php'.$content); 
  </code></pre>