PHP ftp_login() Function

The ftp_login() function logs in to the specified FTP connection.

ftp_login — Logs in to an FTP connection.

bool ftp_login ( resource $ftp_stream , string $username , string $password )

Logs in to the given FTP stream.

Example -

ParameterDescription
ftp_streamThe link identifier of the FTP connection
usernameThe username (USER)
passwordThe password (PASS)

Returns TRUE on success or FALSE on failure. If login fails, PHP will also throw a warning.