title: Cache an XML feed from a remote URL
body: <p>Im using a remote xml feed, and I don't want to hit it every time. This is the code I have so far:</p>
  
  <pre><code>$feed = simplexml_load_file('http://remoteserviceurlhere');
  if ($feed){
    $feed-&gt;asXML('feed.xml');
  }
  elseif (file_exists('feed.xml')){
      $feed = simplexml_load_file('feed.xml');
  }else{
      die('No available feed');
  }
  </code></pre>
  
  <p>What I want to do is have my script hit the remote service every hour and cache that data into the feed.xml file.</p>