Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP ftp_chdir() Function

PHP ftp_chdir() Function


PHP FTP Reference Manual Complete PHP FTP Reference Manual


Definition and Usage

The ftp_chdir() function changes the current directory on the FTP server to a specified directory.

Returns TRUE on success, or FALSE with a warning on failure.

Syntax

ftp_chdir(ftp_connection,directory)

Parameters Description
ftp_connection Required. Specifies the FTP connection to use.
directory Required. Specifies the directory to change to.

Example

"; //Change to the images directory ftp_chdir($conn,"images"); echo "Dir: ".ftp_pwd($conn); ftp_close($ftp_server); ?>

The code above will output:

Dir: /

Dir: /images


PHP FTP Reference Manual Complete PHP FTP Reference Manual