PHP ftp_chdir() Function

The ftp_chdir() function is used to change the current directory to a specified directory on an FTP server.

bool ftp_chdir ( resource $ftp_stream , string $directory )

Changes the current directory to the specified one.

Example -

ParameterDescription
ftp_streamThe link identifier of the FTP connection
directoryThe target directory

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