title: What's the best way to copy an image file from another domain onto local? PHP
body: <p>I need to periodically backup an image file (as is) from my public server onto my local dev server..</p>
  
  <p>What's the best way to go about it? a simple combination of <code>file_get_contents</code> and <code>file_put_contents</code>? or is there some other ways to do this?</p>
  
  <p>and if it's <code>file_get_contents()</code> way, how does one get the contents of an image file properly/exactly in order to simply write it via file_put_contents because i don't think a simple file read is enough. (current tests are writing blank zero byte jpgs). </p>
  
  <p>regards</p>