10.3. FTP

The functions in this section allow you to make connections to FTP servers. FTP is the File Transfer Protocol. While the file functions allow you to open and manipulate remote files by specifying a URL instead of a local path, these functions operate directly with the FTP protocol. They offer a greater degree of control. They also allow you to get a list of files on the server. The FTP functions were added to PHP by Andrew Skalski.

FTP operates in one of two modes, text or binary. In text mode, FTP attempts to translate line endings between different systems. Originally, PHP used the FTP_ASCII and FTP_IMAGE constants for choosing the mode. FTP_TEXT and FTP_BINARY were added for better readability.

Several new functions allow for nonblocking ...

Get Core PHP Programming, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.