title: PHP - best way to copy remote file to local filesystem
body: <p>I have large (6MB currently, keeps getting bigger) xml file on remote server, which I'm using frequently on server. </p>
  
  <p>Downloading it to server every time would take a lots of time, so I'm copying it to local file. </p>
  
  <p>Currently, I'm using <code>file_get_contents</code> and <code>file_put_contents</code> to do so, but that means that whole file must be loaded to memory. </p>
  
  <p><strong>Is there anything like</strong> <code>readfile</code> <strong>, that would just directly stream that xml file to a file on my server?</strong></p>