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

PHP ftp_cdup() Function

PHP ftp_cdup() Function


PHP FTP Reference Manual Complete PHP FTP Reference Manual


Definition and Usage

The ftp_cdup() function changes the current directory to the parent directory on the FTP server.

Returns TRUE on success, or FALSE on failure.

Syntax

ftp_cdup(ftp_connection)

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

Example

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

The code above will output:

Dir: /

Dir: /images

Dir: /


PHP FTP Reference Manual Complete PHP FTP Reference Manual