title: How to transfer files from another server, using FTP, in PHP
body: <p>I am trying to find a way to transfer files from server-to-server. The source server can be any platform, and we may not even really know anything about it except that it supports FTP.</p>
  
  <p>A number of posts I have found on SO recommend using scp, sftp, rsync, or wget for this purpose. Given that this PHP script needs to work every time, and the only thing we know for sure is that the source server supports FTP, how can this be achieved?</p>
  
  <p>I found a couple FTP examples on SO, but they weren't explained very well.</p>
  
  <p>We need to be able to download all files and folders, keeping the same directory structure as well.</p>