FTP Functions


FTP (File Transfer Protocol) functions open, login and close connections, as well as upload, download, rename, delete, and get information on files from file servers. Not all of the FTP functions will work with every server or return the same results. The FTP functions became available with PHP 3.0.1.3. To include this module when compiling PHP, use the --with-ftp (PHP3) or --enable-ftp (PHP4) switches for "./configure". See the official PHP installation instructions for details. The most extensive examples in this chapter can be found under ftp_cdup() and ftp_rawlist() . PHP does not automatically close the connection to the FTP server after the script ends. More information on FTP can be found at www.faqs.org/rfcs/rfc959.html.