title: PHP Get Contents of a URL or Page
body: <p>I am trying to create a PHP script which can request data, such as HTML content, from an external server, then do something with the received content. Here is a generalized example of what I am trying to accomplish:</p>
  
  <pre><code>//Get the HTML generated by http://api.somesite.com/
  
  //Now tack on the Unix timestamp of when the data was received
  $myFetchedData = $dataFromExternalServer . "\n Data received at: ". time();
  
  echo $myFetchedData;
  </code></pre>
  
  <p>I'm thinking I should use curl in here somewhere, but I am not sure after that. Could someone post a generalized example of how I could do this?</p>